3 ms·
Yes. See Smalltalk for a language with object-oriented homoiconicity.
by cwp 11y ago
Yes. See Smalltalk for a language with object-oriented homoiconicity.
- stray 11y agoThat's not really homoiconicity though, is it? Smalltalk source code does not appear to be expressed in terms of a Smalltalk data structure. Whereas Lisp source code is expressed as lists of lists.
- cwp 11y agoSure it is. All parts of a Smalltalk program are present as objects that can be manipulated by sending them messages. Classes, methods, variable bindings, closures, stack frames, even individual messages are objects. As a practical matter, methods also have a textual representation, but that's not strictly necessary. Ten or fifteen years ago, the Squeak method browser had a mode where you could write Smalltalk code using tiles, kind of like in Etoys, no parsing necessary. That was a hassle to use, though, so people stuck with writing methods using text. By the way, Lisp has the same sort of "impurity". S-expressions are very simple, but they are syntax. It's surely possible to create a tool that would let one construct cons cells in memory directly, but that would be a hassle. Instead we use parentheses.
- stray 11y agoThe 'iconicity' part of homoiconicity refers to the textual representation.