Re:Just what does “code as data” mean anyway? (2014)
by skybrian on Friday February 16, 2018 @11:19AM
(#16393389)
In Lisp, my understanding is that while you can manipulate the AST directly, you will likely introduce a bug unless you use the special functions for handling hygienic macros? And each flavor of Lisp has its own way of doing hygienic macros.
[ Parent
| on HN ]
Re:Just what does “code as data” mean anyway? (2014)
by offlineguy on Friday February 16, 2018 @12:57PM
(#16394254)
If you don’t know what you’re doing, you can introduce bugs regardless of programming language.
Re:Just what does “code as data” mean anyway? (2014)
by flavio81 on Friday February 16, 2018 @12:05PM
(#16393761)
>>use the special functions for handling hygienic macros? And each flavor of Lisp has its own way of doing hygienic macros.
There are two main flavors of Lisp: Common Lisp and Scheme;
Scheme already has hygienic macros as default; and writing hygienic macros is trivial (and easy) in Common Lisp.
>you will likely introduce a bug unless
You won't "introduce a bug" if what you need is specifically an unhygienic macro. They have their uses, so it's good to be able to write unhygienic macros as well.
Re:Just what does “code as data” mean anyway? (2014)
by Jtsummers on Friday February 16, 2018 @12:15PM
(#16393849)
You can use gensym in common lisp to introduce a new symbol that is guaranteed not to exist already. If you do this your macros become hygienic. In my experience this isn't that big a burden. And sometimes you want to access existing symbols through your macros.