4 ms·
Your definition of homoiconicity is different than any I've ever seen, which is something like "the language's own code is a first-class data type" (see the dis
by icebraining 9y ago
Your definition of homoiconicity is different than any I've ever seen, which is something like "the language's own code is a first-class data type" (see the discussion on the C2 wiki, for example: http://wiki.c2.com/?DefinitionOfHomoiconicDiscussion http://wiki.c2.com/?DefinitionOfHomoiconicDiscussion)
- kazinator 9y agohttps://en.wikipedia.org/wiki/Homoiconicity https://en.wikipedia.org/wiki/Homoiconicity uncovers where the term came from: the paper describing a text processing language called TRAC. Nothing about a fist-class data type other beyond the character string. It seems to have been contrived by sticking the greek prefix "homo" (same) onto "iconic", which is derived from "ikonos" (image). The code in the machine has the same (homo) image (ikonos) as what came from the keyboard. The Lisp example in that page is irrelevant. eval is not required, in fact, to walk the nested list data structure; some Lisps have an eval which compiles to native code, then calls the resulting function. Lisp data is somewhat homoiconic in that it has a representation which converts back to text. It's not exactly the original text, but there is an important concept at play called "read/print consistency". It is weaker than homoiconicity, which preserves the exact character spelling, more or less.