Hacker News new | ask | show | jobs
by gokr 3643 days ago
I should mention that Spry uses all of () []{}. The () are reified as Paren as in Rebol which makes it useful in templating etc. {} are used to create Maps, like {x = 1} creates a Map with one kv pair.
1 comments

I tried to find an example of the macro-like approach of Spry and couldn't. How is it expressed?
It's not as evolved yet - but funcs pull in arguments via :x and can instead use :$x (I used ^ earlier, but switched to $) which will pull in that AST node (argument) without evaluating it first at the call site.

So it's a kind of quoting. I haven't pushed these things further yet, and frankly I am not that heavily into macros unless they are really needed. But obviously AST manipulation is easy in Spry.

In case you want to work on that, be sure to define how quote and eval work with respect to the lexical environment.