zaphar / ucg

A Universal Configuration Grammar
Apache License 2.0
36 stars 3 forks source link

Allow macros to use copy on write for the tuples defining their body. #1

Closed zaphar closed 5 years ago

zaphar commented 5 years ago

It would be nice if you could allow macros to modify existing tuples as a way to do macro composition easily.

example syntax might be:

let base = { ... };
let mymacro = macro(arg) => base{
    new_field = arg,
};

or alternatively:

let mymacro = macro(arg) => othermacro("foo"){
    new_field = arg,
};

This would allow a form of chaining for macro applications that avoids the hold accidental recursive macro problem.

zaphar commented 5 years ago

With the change to macros/functions being any expression this is now unnecessary.