4 ms·
Cmacro: Lisp Macros for C
- informatimago 4y agoOr elpp: https://github.com/informatimago/elpp/blob/master/elpp.el https://github.com/informatimago/elpp/blob/master/elpp.el
- slaymaker1907 4y agoI think this is doing something more sophisticated since it seems to understand C syntax. I don’t think it’s hygienic though which is a shame.
- bitwize 4y agoWhen people say "Lisp macros" they usually mean Common Lisp defmacro-flavored ones. Any problems introduced by lack of hygiene can be papered over with separate variable and function namespaces and gensyms.
- slaymaker1907 4y agoNot really because a huge feature of hygiene is accurate symbol provenance for syntax error reporting. syntax-case (syntax-parse for Racket) lets you do anything a Common Lisp like macro system can do but is still hygienic by default.
- smegsicle 4y agohygienic macros are a fun intellectual curiosity but using regular macros with gensym as needed is more practical
- shirleyquirk 4y agoOh man I couldn't disagree more. Having used Nim's hygienic templates, I strongly believe the escape hatch should be the other way round. Hygienic by default, tag individual identifiers as being 'dirty' to inject them as is into the surrounding scope. Edit: actually, I realize I don't know whether you meant 'macro' in the C sense or the Lisp sense. I was thinking C
- marcodiego 4y agoThe example using qsort illustrate how good was the lambda proposal for c23 that was rejected.
- FrozenVoid 4y agoLambdas can still be written using GCC extensions. https://github.com/FrozenVoid/C-headers/blob/main/lambda.h https://github.com/FrozenVoid/C-headers/blob/main/lambda.h
- beeforpork 4y agoWow, returning a local function from a ({...}) block is sick. I like that.
- zetalyrae 4y agoThat's me! I was really naive about parsing back then and the "parser" is really not stellar.