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

Doug McIlroy coined homoiconic as meaning that the programs are stored in the way that the programmer has entered them.

The POSIX shell is homoiconic because after you have defined some functions, you can execute the command "set" (with no arguments) to see the definitions. They are stored in a form that can be copy and pasted into the shell. (There may be reformatting and comments removed).

The homoiconic feature in Lisp (Common Lisp) is the ED function. It will recall the textual definition of a function, allowing it to be edited.

The big idea in Lisp of using a data structure for manipulating code isn't homoiconic; the data structure definitely isn't in the source code format. It's homoiconic to the extent that uncompiled code can be stored as a data structure and converted back to a character-level of representation. (This is possible due to something that Lisp calls print-read consistency, an important concept in Lisp.)

The code-to-code transformations in Lisp do not work by converting code to text and back again.

We can take advantage of that even if we go through some front-end that provides a surface syntax, like infix.cl, which loses homoiconicity.

So rather that homoiconicity, the two concepts important in Lisp are print-read consistency and code as a data structure.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: