gilch / hissp

It's Python with a Lissp.
https://gitter.im/hissp-lang/community
Apache License 2.0
364 stars 9 forks source link

Compose macro (^# tag) #211

Closed gilch closed 1 year ago

gilch commented 1 year ago

Highly experimental and subject to change. Not all of the #154 ideas have been implemented yet. This one corresponds to the Arc/Anarki ssyntax as mentioned in the wiki page. I designed it to be even more powerful, based on some experience with Hissp's spiritual predecessor Drython (and a few other languages). You can almost write straight-up Lissp inside a symbol, with enough escapes (which is mostly useless, but there if you need it). Unlike Arc, it's not built into the Lissp reader, but requires a reader tag. Its expansion is also a lot more complex and kind of opaque compared to Arc's. Some fairly complex functions can be implemented as terse one-liners. Implementation is the best name.

It's definitely one of the more complex macros bundled, but still implemented in about a page of Lissp, and suprisingly a lot of that is in a single boolean expression trying to decide if the thing we just read is callable. It's defined pretty late in the file and really leverages the other bundled macros.