X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week1.mdwn;h=9d59991e55c7896eb5c8a31bafc4a793c88eb91c;hp=e65919563b4ac23de3d1140d07172f6e9f141f14;hb=50e12a5e7f746472fec8159ad0d0bf83a4e514e4;hpb=e4deceea664344b0c6edffd2fac9c55bd7786fbc diff --git a/week1.mdwn b/week1.mdwn index e6591956..9d59991e 100644 --- a/week1.mdwn +++ b/week1.mdwn @@ -57,7 +57,7 @@ We'll tend to write (λa M) as just `(\a M)`, so we don't hav Application: (M N) -Some authors reserve the term "term" for just variables and abstracts. We won't participate in that convention; we'll probably just say "term" and "expression" indiscriminately for expressions of any of these three forms. +Some authors reserve the term "term" for just variables and abstracts. We'll probably just say "term" and "expression" indiscriminately for expressions of any of these three forms. Examples of expressions: @@ -70,12 +70,11 @@ Examples of expressions: (x (\x x)) ((\x (x x)) (\x (x x))) -

The lambda calculus has an associated proof theory. For now, we can regard the proof theory as having just one rule, called the rule of **beta-reduction** or "beta-contraction". Suppose you have some expression of the form: - ((\a M) N) + ((\ a M) N) that is, an application of an abstract to some other expression. This compound form is called a **redex**, meaning it's a "beta-reducible expression." `(\a M)` is called the **head** of the redex; `N` is called the **argument**, and `M` is called the **body**. @@ -604,7 +603,6 @@ Here's how it looks to say the same thing in various of these languages. It's easy to be lulled into thinking this is a kind of imperative construction. *But it's not!* It's really just a shorthand for the compound "let"-expressions we've already been looking at, taking the maximum syntactically permissible scope. (Compare the "dot" convention in the lambda calculus, discussed above.) - 9. Some shorthand OCaml permits you to abbreviate: @@ -675,9 +673,11 @@ Here's how it looks to say the same thing in various of these languages. and there's no more mutation going on there than there is in: + When a previously-bound variable is rebound in the way we see here, that's called **shadowing**: the outer binding is shadowed during the scope of the inner binding.