Hacker News new | past | comments | ask | show | jobs | submit login

Why with the "sarcasm"?



Because C macros have no sense of context; they're replaced in the raw character stream while lexer is reading in a file. C macros are mostly stupid string-replacements of the s/foo/bar/g type.

Lisp macros operate on the abstract syntax of the code forms, after it's parsed. They're tree-transforms. They could also be nested, so one macro would operate on the result of another. All of them could also operate on the values read by reader macros, which are Lisp's C-like preprocessor macros: A lisp macro that frobs vectors could, for example, processes code that looks like any of the following: foo[], vector foo, (vector foo), (array 1 ..), etc. if the appropriate reader syntax is defined for them. That's right, ONE macro to do all that.


Ah, that makes sense. Thanks for the explanation.


It's not sarcasm, I'm sure he's implying that while the two techniques have identical names, they are totally different in essence




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: