Repository navigation
v0.7.0
Added
- Call chaining
recv.name(args). A.attached to a form, then a name and
an attached(, rewrites the receiver into the call's first argument:
1.increment()reads as(increment, 1), and
foo(1 2 3).bar(4 5 6).baz(7 8 9)as
(baz, (bar, (foo, 1, 2, 3), 4, 5, 6), 7, 8, 9). Chains fold left-to-right.
This is pure reader rewriting, not method dispatch —1.increment()is
exactlyincrement(1). Like the attachment rule it is whitespace-sensitive:
the., name, and(must each abut the token before them. (1.5is still a
decimal — a.is only a chain dot when no digit follows.)
Changed
- TitleCase macro sugar no longer spreads internal capitals. A TitleCase
head is now lower-cased whole before gaining its-MACROsuffix, instead of
inserting a hyphen at each interior capital:DefMacro↦defmacro-MACROand
DefType↦deftype-MACRO(previouslydef-macro-MACRO/def-type-MACRO),
while single-word heads likeIf↦if-MACROare unchanged. A multi-word
user macro must now be defined under the single lower-case word it is invoked
as — e.g. defineDefMacro trylet …and invoke it asTryLet …(previously
DefMacro try-let …). Detection is unchanged: a token is a macro head when it
starts with a capital and contains at least one lower-case letter. - Function calls are now WAVE tuples with the head first.
foo(1 "baz")
reads and prints as(foo, 1, "baz")(previously the variant casefoo
carrying a payload). Special forms and macros share the shape:If c t eis
(if-MACRO, c, t, e), andIf(c t e)reads identically. Evaluating any
parenthesized form is a call — its head is resolved and applied to the bundled
arguments (0 ⇒ the empty tuple, 1 ⇒ that value, ≥2 ⇒ a tuple) — so a literal
tuple value now comes only fromQuoteor a builtin.(foo)is a
zero-argument call (parenthesized grouping is gone), and()is the empty
tuple (an error if evaluated).form-kindreportstupfor a quoted call;
callis now only a runtime variant carrying a payload (ok(1)). wavelet readnow defaults to stdin when given no file argument.echo '...' | wavelet readreads the program from standard input; passing a path
still reads that file. Previously stdin required an explicit/dev/stdin.
Removed
- List and record call sugar
foo[a b]andfoo{k: v}. Writefoo([a b])
andfoo({k: v})instead. Only(attaches to a name now; attaching[or
{to a name is a read error that points at the new spelling. (Free-standing
[…]list and{…}record/flag values are unaffected.) ///doc comments. A///line is now an ordinary//comment: its text
is discarded by the reader instead of attaching to the following form, and it
no longer appears as a WIT doc comment inwavelet witoutput or on LSP hover.
What's Changed
- Collect small wins into dev-notes/blueberries.md by @logaan in #4
- Plan: switch canonical call form from variants to tuples by @logaan in #3
- Make
wavelet readdefault to stdin by @logaan in #6 - Investigation: dropping the interpreter for the compiler by @logaan in #2
- docs: plan for running macros defined in other components by @logaan in #1
- Calls are tuples, not variants by @logaan in #8
- docs: dedicated, numbered Reader sugar page by @logaan in #7
- docs+refactor: scripts/README.md and a scripts/ci/ split by @logaan in #5
- Drop
///doc comments from the language by @logaan in #11 - feat(reader): call-chaining sugar
recv.name(args)by @logaan in #10 - Drop internal-capital spreading from TitleCase macro sugar by @logaan in #9
New Contributors
Full Changelog: v0.6.0...v0.7.0