3 ms·
In case you didn't know: "Languages in which program code is represented as the language's fundamental data type are called 'homoiconic'." From: http://c2.com/
by Rickasaurus 14y ago
In case you didn't know: "Languages in which program code is represented as the language's fundamental data type are called 'homoiconic'."
From: http://c2.com/cgi/wiki?HomoiconicLanguages http://c2.com/cgi/wiki?HomoiconicLanguages
I didn't.
- gruseom 14y agoThere's an ambiguity in that definition: what does "represented" mean? It can mean "represented as source code", i.e. for consumption by the programmer, or it can mean "represented as runtime state", i.e. for consumption by the machine. The first is what the OP means by code-as-text and the second is what the OP means by code-as-data. A program always has both kinds of representation. Without a textual representation, no one could write or read it. Without a runtime representation, it couldn't be executed. But usually it is complicated to translate between the two. In Lisp (the classic homoiconic language), these representations are so similar that it is trivial to translate from one to the other and back again. That's what makes Lisp good for metaprogramming (writing programs that manipulate other programs): it's so easy to go back and forth between the human-friendly representation (source code) and the runtime representation (data) that a whole class of new techniques arises.