summaryrefslogtreecommitdiff
path: root/notes/250210-cons.md
diff options
context:
space:
mode:
Diffstat (limited to 'notes/250210-cons.md')
-rw-r--r--notes/250210-cons.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/notes/250210-cons.md b/notes/250210-cons.md
index 3146957..1ce97b9 100644
--- a/notes/250210-cons.md
+++ b/notes/250210-cons.md
@@ -178,3 +178,34 @@ multiple values!
(The phrase "argument list" is probably going to stick around forever
though, even if it's technically wrong in Zisp.)
+
+## Grammar switch-up!
+
+_2026 January_
+
+For [reasons](260106-grammar.html) I've decided to actually use the
+ampersand in place of the dot in Zisp s-expressions. Not like in the
+paper linked above; the ampersand simply replaces the dot in the
+representation of improper lists.
+
+Here's how some snippets from above would look with the new grammar:
+
+```scheme
+
+(define (map* proc & args)
+ (map proc (list & args)))
+
+(define combine*
+ (case-lambda
+ ((x) x)
+ ((x y & rest) (combine* (combine x y) & rest))))
+
+(define (foobar & rest)
+ (let-values (((x y z) rest))
+ ;; This is a meaningless example for demonstration, since we
+ ;; could have just made the function accept three parameters.
+ ;; The `let-values` here is the one from SRFI 11.
+ ))
+
+(apply display-if-found (lookup '((x & y)) 'x)) ;; displays x
+```