plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
83ce3b8
— Peter John
2026-07-20T21:19:28+05:30
docs: scope closures spec to ordinary-argument call syntax, not trailing-closure
docs/superpowers/specs/2026-07-20-closures-design.md
CHANGED
|
@@ -24,6 +24,13 @@ and matches every known real usage (reading `res`/`sep`, not reassigning them fr
|
|
|
24
24
|
closure). Live/shared capture is explicitly out of scope — flagged here as a real semantic choice,
|
|
25
25
|
not an oversight, in case a future use case needs it.
|
|
26
26
|
|
|
27
|
+
**Call syntax: ordinary-argument only**, not trailing-closure syntax. `list.plum`'s draft usage
|
|
28
|
+
(`this.each() |v| { ... }` — the closure attached *after* a completed call, Ruby/Kotlin-style) is a
|
|
29
|
+
distinct, more elaborate grammar feature (a call expression optionally followed by a closure) than
|
|
30
|
+
a closure used as a normal expression. Since `list.plum` itself gets rewritten to standard syntax
|
|
31
|
+
in a later, separate follow-up, this feature only needs to support a closure passed as an ordinary
|
|
32
|
+
call argument — `each(|v| ...)` — not the trailing-block form.
|
|
33
|
+
|
|
27
34
|
## Design
|
|
28
35
|
|
|
29
36
|
### 1. Grammar (`tooling/tree-sitter-plum`)
|