4 ms·
There is a project by Fernando Borretti for Lisp-style macros in C, with macro expander written in Common Lisp: https://github.com/eudoxia0/cmacro https://githu
by mapcars 11y ago
There is a project by Fernando Borretti for Lisp-style macros in C, with macro expander written in Common Lisp: https://github.com/eudoxia0/cmacro https://github.com/eudoxia0/cmacro, and a collection of basic macros: https://github.com/eudoxia0/magma https://github.com/eudoxia0/magma
This way he has already added lambdas, lazy evaluation, types, anaphoric macros, with- macros.
- deleted 11y ago[deleted]
- eudox 11y agoThe difference between cmacro is it builds on C syntax (and allows for syntax extensions, by having a very flexible parser), while this is more like the "defmacro for C" system described here[0] and here[1], because it uses a Lisp syntax. I prefer the former approach because it's less likely to alienate C programmers. At the same time, being able to define new syntax can have the same effect, since every new syntax you add carves out a smaller and smaller set of the community that is willing to use it. The same is true for Common Lisp reader macros, which is why few of the many syntax extensions that are available become commonly used. [0]: http://www.european-lisp-symposium.org/editions/2014/ELS2014.pdf http://www.european-lisp-symposium.org/editions/2014/ELS2014... [1]: http://www.european-lisp-symposium.org/editions/2014/selgrad.pdf http://www.european-lisp-symposium.org/editions/2014/selgrad...