News for hackers. Stuff that matters.
Re:Lisp: It's Not About Macros, It's About Read by mattdeboard on Saturday February 18, 2012 @05:39PM (#3607951)
So, I have a question. After reading this article and thinking about homoiconicity and macros, I remembered the Python source for the `namedtuple` function: http://dpaste.com/704870/

Is this considered a macro? Is it homoiconic? It's code as data and using input variables to generate code based on that input. It struck me as weird the first time I read through it but figured since I'm pretty stupid that there's a good reason for it.

Re:Lisp: It's Not About Macros, It's About Read by andreasvc on Sunday February 19, 2012 @06:52AM (#3609163)
It's not as powerful as what you could do with Lisp. The code is not a first-class object, so you can't for example substitute variable a for variable b. The "data" in code as data refers to an abstract syntax tree, not just a string which happens to contain code. Python does give you access to abstract syntax trees, but because of the complexity of the language this is less useful than with Lisp.
Re:Lisp: It's Not About Macros, It's About Read by mattdeboard on Sunday February 19, 2012 @09:28AM (#3609407)
Thanks for helping with the distinction