Earlier quoted context omitted.
Scheme might be different here, I'd have to read the standard, but it's true of Common Lisp at least. You have to distinguish here, I think, between what's valid input to eval and the evaluation rules for given inputs. Anyways, here's CL's spec for eval[1]: eval form => result* Form is defined in the glossary as "form n. 1. any object meant to be evaluated. 2. a symbol, a compound form, or a self-evaluating object."[…
> Scheme might be different here [...] Yep, I meant to specify that a subset of your original claim is true for all Lisps, not that your claim was not true for certain ones like CL. > IMO, the useful definition of homoiconicity is "the domain and codomain of eval are the same type". I do not think that is a useful definition. Under that definition, any language can be made homoiconic by providing a library with an ev…
Except this is never true, unless your AST is a string. And Racket’s internal representation (syntax objects) is much more complicated than what is apparent from the text. So, in my opinion, defining homoiconicity in terms of the textual syntax is basically impossible. (And I’m sympathetic to Shriram Krishnamurthi’s claim that homoiconicity doesn’t mean anything).
The interesting property, in my opinion, is that languages like Common Lisp are not specified in terms of the textual syntax and so the textual representation is irrelevant to the semantics of the program: a visual tool that produces lisp forms is as valid a “syntax” of Common Lisp as the standardized textual representation produced by READ.