From 28e1ddd1aefa8348ad1c7aaf6cb3bc818c595e57 Mon Sep 17 00:00:00 2001
From: jim
Date: Sat, 14 Feb 2015 10:37:51 -0500
Subject: [PATCH] clarify dot rule
---
topics/week2_lambda_intro.mdwn | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/topics/week2_lambda_intro.mdwn b/topics/week2_lambda_intro.mdwn
index e8aa8467..6bbb5399 100644
--- a/topics/week2_lambda_intro.mdwn
+++ b/topics/week2_lambda_intro.mdwn
@@ -198,9 +198,7 @@ and:
z (\x (x y))
-**Dot notation** Dot means "assume a left paren here, and the matching right
-paren as far to the right as possible without creating unbalanced
-parentheses". So:
+**Dot notation** Dot means "Insert a left parenthesis here, and the matching right parenthesis as far to the right as possible without creating unbalanced parentheses---so long as doing so would enclose an application or abstract not already wrapped in parentheses." Thus:
\x (\y (x y))
@@ -229,11 +227,14 @@ abbreviates:
((\x (\y (x y))) x)
The outermost parentheses were added because we have an application. `(\x. \y.
-...)` became `(\x (\y. ...))` because of the rule for dots. We didn't have to
+...)` became `(\x (\y. ...))` because of the rule for dots. We didn't
insert any parentheses around the inner body of `\y. (x y)` because they were
already there. That is, in expressions of the form `\y. (...)`, the dot abbreviates
nothing. It's harmless to write such a dot, though, and it can be conceptually
-helpful especially in light of the next convention...
+helpful especially in light of the next convention.
+
+Similarly, we permit `\x. x`, which is shorthand for `\x x`, not for `\x (x)`, which
+our syntax forbids. (The [[lambda evaluator|/code/lambda_evaluator]] however tolerates such expressions.)
**Merging lambdas** An expression of the form `(\x (\y M))`, or equivalently, `(\x. \y. M)`, can be abbreviated as:
--
2.11.0