flan/test/programs/pkgs/macring/macring.flan
Joseph Ferano 69646e534e A macro's parameter list, and one grammar for it
(defmacro do-grid [[r rows c cols] & body] ...) — positional names, a [ ]
pattern wherever an argument is a vector, and & for the tail. The reading of
the list lives in Expand, below both sides that need it: Parse turns it into
the bindings a macro body opens with, and Macro checks a call against the same
reading before expanding it, so arity and shape are refused with the call's own
location rather than with the Loc.from_macro stamp every node of an expansion
carries.

The breaking half: [args] used to bind the whole argument list and now binds
the first argument. The whole list is [& args], and every defmacro in the tree
— prelude, vendor, tests, the elisp fixtures — was migrated to it. One grammar,
not a legacy mode.
2026-09-20 18:18:24 +07:00

11 lines
391 B
Plaintext

;;;; A ring of macros, in a package. Neither body can be compiled first, so
;;;; there is no order to compile them in -- and an import's macros go through
;;;; the same rounds as the file's own, so the refusal has to fire here too.
;;;; Nothing in this package calls them, so the ring is found by the importer.
(defmacro ping [& args]
(pong args))
(defmacro pong [& args]
(ping args))