4 ms·
What makes Common Lisp macros easier to use than Scheme's?
by sesquipedalian 11y ago
What makes Common Lisp macros easier to use than Scheme's?
- NhanH 11y agoScheme macro is hygienic, which make certain type of macro impossible to be done (those that capture itself). Also depend on who you ask, hygienic macro is slightly more annoying to use.
- kenko 11y agosyntax-rules macros can break hygiene: http://okmij.org/ftp/Scheme/macros.html#dirty-macros http://okmij.org/ftp/Scheme/macros.html#dirty-macros
- shiggerino 11y agoNo need for a special metaprogramming DSL, macros are written in plain Common Lisp. Hygiene is a non-issue since you have the GENSYM function which gives you a new symbol guaranteed to be unique.
- deleted 11y ago[deleted]
- drmeister 11y agoIn short Common Lisp has two namespaces, one for functions and macros and a second for variable names - Scheme has one namespace. So you have fewer conflicts in naming in Common Lisp. In Scheme there is a lot of concern about hygienic macros that don't mess up the namespace. For more on that here is an inflammatory but well thought out exposition. http://www.xach.com/naggum/articles/3236789642671151@naggum.net.html http://www.xach.com/naggum/articles/3236789642671151@naggum.... The book Let Over Lambda lays it out really well as well.
- sklogic 11y agoLack of enforced hygiene, for starters. Hygienic R5RS-style macros are nice and all that, but only for petty language extensions, and they're a noticeable obstacle if you want to implement more complex, deeply staged DSLs. It's possible to find workarounds for most of that things, but yet, not having hygiene in the first place is better.