X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week1.mdwn;h=a181ea659f034143bcfcf1694236a03a9e1c949f;hp=801ae6984609be27b76abc8ca7f378fc93020dc6;hb=a5e3b3ac7d32776ed29cde5e5604696e3e2c3abc;hpb=787216b36925c3757985a48ced39d6eee1ee5392
diff --git a/week1.mdwn b/week1.mdwn
index 801ae698..a181ea65 100644
--- a/week1.mdwn
+++ b/week1.mdwn
@@ -59,7 +59,6 @@ We'll tend to write (λa M)
as just `(\a M)`, so we don't hav
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.
-
-true and true = true
-true and true = true
-true and * = *
-true and false = false
-* and true = *
-* and * = *
-* and false = *
-false and true = false
-false and * = false
-false and false = false
-
+ true and true = true
+ true and * = *
+ true and false = false
+ * and true = *
+ * and * = *
+ * and false = *
+ false and true = false
+ false and * = false
+ false and false = false
And then we'd notice that `* and false` has a different intepretation than `false and *`. (The same phenomenon is already present with the material conditional in bivalent logics; but seeing that a non-symmetric semantics for `and` is available even for functional languages is instructive.)
@@ -543,7 +544,7 @@ Here's how it looks to say the same thing in various of these languages.
(let* [(bar (lambda (x) B))] M)
- then wherever `bar` occurs in `M` (and isn't rebound by a more local "let" or "lambda"), it will be interpreted as the function `(lambda (x) B)`.
+ then wherever `bar` occurs in `M` (and isn't rebound by a more local `let` or `lambda`), it will be interpreted as the function `(lambda (x) B)`.
Similarly, in OCaml:
@@ -603,8 +604,7 @@ Here's how it looks to say the same thing in various of these languages.
let x = A;;
... rest of the file or interactive session ...
- 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.)
-
+ 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
@@ -676,9 +676,8 @@ 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:
-
- ∀x. (F x or ∀x (not (F x)))
-
+ ∀x. (F x or ∀x (not (F x)))
+
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.
@@ -755,7 +754,7 @@ Or even:
(define foo B)
(foo 2)
-don't involve any changes or sequencing in the sense we're trying to identify. As we said, these programs are just syntactic variants of (single) compound syntactic structures involving "let"s and "lambda"s.
+don't involve any changes or sequencing in the sense we're trying to identify. As we said, these programs are just syntactic variants of (single) compound syntactic structures involving `let`s and `lambda`s.
Since Scheme and OCaml also do permit imperatival constructions, they do have syntax for genuine sequencing. In Scheme it looks like this:
@@ -796,18 +795,3 @@ We'll discuss this more as the seminar proceeds.
-1. Declarative vs imperatival models of computation.
-2. Variety of ways in which "order can matter."
-3. Variety of meanings for "dynamic."
-4. Schoenfinkel, Curry, Church: a brief history
-5. Functions as "first-class values"
-6. "Curried" functions
-
-1. Beta reduction
-1. Encoding pairs (and triples and ...)
-1. Encoding booleans
-
-
-
-
-