![]() To evaluate a variableīinding, we use the “current dynamic environment” (the values of preceding bindings) to evaluate e and produce a “new dynamic environment”: x having the value v (value is an expression that “has no more computation to do”) where v is the result of evaluating e. ![]() To type-check a variable binding e, we use the “current static environment” (the types of preceding bindings) to type-check e and produce a “new static environment”: x having type t where t is the type of e. Is roughly the values of the preceding bindings in the file. How a binding is evaluated depends on a dynamic environment (or just environment), which What type (if any) a binding has depends on a static environment (or context), which is roughly the types of the preceding bindings in the file. Syntax is how to write it, but we still need to know its semantics (how it type-checks and evaluates). Here, val is a keyword, x can be any variable, and e can be any expression. There are several kinds of bindings.Ī variable binding in ML has this syntax: Each binding gets type-checked and then (assuming it type-checks) evaluated. We will learn ML in a way that teaches core programming-languages concepts. Section 1 Variable Bindings and Expressions
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |