4 ms·
and again, I'm afraid by code generation Do you use macro and higher order function? If you do, you already use code generation, so why are you afraid ?
by nick__m 2y ago
and again, I'm afraid by code generation
Do you use macro and higher order function? If you do, you already use code generation, so why are you afraid ?
- medo-bear 2y agoBecause macros in common lisp are very easy to grok, which is not to say that common lisp programmers promote willy-nilly use of macros
- nick__m 2y agoUnlike Scheme, CL macro are glorified template based code generator. If your not careful to use facilities like gensym and packages it easy to accidentally capture already binded terms at call site.
- lispm 2y agoIf we look at macros in Scheme R7RS they are mostly transformers on patterns. -> https://standards.scheme.org/corrected-r7rs/r7rs-Z-H-6.html#TAG:__tex2page_sec_4.3 https://standards.scheme.org/corrected-r7rs/r7rs-Z-H-6.html#... > If your not careful to use facilities like gensym and packages it easy to accidentally capture already binded terms at call site. Luckily CL programmers have heard about that and are usually careful about that.
- vindarel 2y agoI mean code generation that writes code to files. I'm afraid they bit rot fast and make upgrading harder. Macros generate code on the fly, not in my source files.
- mst 2y agoI tend to regard code generation as being something that should -feel- like a macro to use, just one that optionally materialises the results so you can ship the code without a dependency on the generation logic. I am very conscious that most code generation in the wild is ... Not That.