docs: clarify fn*/let*/loop* take plain symbols only (jolt-f79)
grammar.ebnf: the destructuring note already attributed patterns to the binding MACROS; make the boundary explicit — the fn*/let*/loop* PRIMITIVES they desugar to take plain symbols only (a non-symbol binding errors, as in Clojure). self-hosting-compiler.md: the 'compile destructuring via a shared destructure expander instead of falling back' item is done (and its jolt-7dl ref was stale) — destructuring now compiles through the fn/let/loop/defn macros' desugaring; the primitives reject patterns.
This commit is contained in:
parent
d1d3f390ff
commit
8a9e386fa7
2 changed files with 10 additions and 5 deletions
|
|
@ -164,8 +164,11 @@ feature = ":clj" | ":cljs" | ":default" | keyword ;
|
|||
tagged-literal = "#" , symbol , ws , form ;
|
||||
|
||||
(* ── Destructuring (semantics, not reader syntax) ────────────────────────────
|
||||
The reader produces plain vectors and maps; the binding forms (let, fn, loop,
|
||||
doseq, for, defmacro params, …) interpret them as destructuring patterns:
|
||||
The reader produces plain vectors and maps; the binding MACROS (let, fn, loop,
|
||||
doseq, for, defmacro params, …) interpret them as destructuring patterns. The
|
||||
PRIMITIVES they desugar to — fn*, let*, loop* — take plain symbols ONLY (a
|
||||
non-symbol binding is an error, as in Clojure: "fn params must be Symbols" /
|
||||
"Bad binding form, expected symbol"). The grammar of a pattern:
|
||||
|
||||
binding = symbol | seq-binding | map-binding ;
|
||||
seq-binding = "[" , { binding } , [ "&" , binding ] , [ ":as" , symbol ] , "]" ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue