masak / alma

ALgoloid with MAcros -- a language with Algol-family syntax where macros take center stage
Artistic License 2.0
137 stars 14 forks source link

Unify splicing into quasi with splicing macro expansion into mainline #380

Open masak opened 6 years ago

masak commented 6 years ago

As the title says, both kinds of splicing require (a) cloning and (b) OUTER-displacement à la Q::Expr::BlockAdapter.

The (b) step is probably what's missing for #207 to work at this point. The unification is the obvious next step, since these processes are very similar.

masak commented 5 years ago

While this still seems like a good idea, our hopes nowadays go to #410 for sorting out #207.

masak commented 5 years ago

Would also like to add: as of #410, quasi interpolation and macro splicing are known to differ in one significant way — one does uniquification of identifiers, the other does de-uniquification.

Still, it doesn't seem like a bad idea to unify these two processes, which are otherwise quite similar.

masak commented 5 years ago

Would also like to add: as of #410, quasi interpolation and macro splicing are known to differ in one significant way — one does uniquification of identifiers, the other does de-uniquification.

I'd like to suggest that past-me is being confused here. (Gasp!) Quasi interpolation and macro splicing are different. But let's compare four important steps during a macro call:

  1. Argument capture/detachment
  2. Quasi unquote interpolation
  3. Quasi fixed-code detachment
  4. Macro result insertion

I'd say 1 and 3 are pretty similar (and would want to do detachment/uniquification) whereas 2 and 4 are also pretty similar (and would want to do re-attachment/de-uniquification).