From 910b1697e16bfb77a46dd39914116c5102519c41 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Tue, 6 Jan 2026 09:06:32 +0100 Subject: Add & update notes on new grammar. --- notes/250210-cons.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'notes/250210-cons.md') 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 +``` -- cgit v1.2.3