4 ms·
Lisp: "All code is data" That's not the question. "All data is code" is not the same statement. In a different context: "All apples are fruit" may be true but
by nonchalance 13y ago
Lisp: "All code is data"
That's not the question. "All data is code" is not the same statement.
In a different context: "All apples are fruit" may be true but that doesn't imply "all fruit are apples"
- TeMPOraL 13y agoLisp programmers think "data is code and code is data, both are the same thing and they're interchangeable". As it happens to actually be. I point to GEB [0] for more detailed discussion of this, but let me give you a few examples which point out that the distinction between code and data is mostly meaningless. - Ant build descriptions that look suprisingly like executable Lisp code if you replace "<tag> ... </tag>" with "(tag ...)". - Musical notation which is obviously code for humans playing instruments (it even has loops, I think, AFAIR from my music lessons; don't know about conditionals; if it has them, maybe it's Turing-complete? (ETA it would seem it is[3])). - Windows Metafile format for bitmap and vector graphics which is basically a serialized list of WinAPI calls [1]. - "fa;sldjfsaldf" - the "not code, just data" example from [2] that happens to be "a Teco program that creates a new buffer, copies the old buffer and the time of day into it, searches and then selectively deletes". Oh, and it's also "a brainfuck program that does nothing, and a vi program to jump to the second "a" forwards and replace it with the string "ldjfsaldf"". [0] - https://en.wikipedia.org/wiki/G%C3%B6del,_Escher,_Bach https://en.wikipedia.org/wiki/G%C3%B6del,_Escher,_Bach [1] - http://en.wikipedia.org/wiki/Windows_Metafile http://en.wikipedia.org/wiki/Windows_Metafile [2] - http://www.c2.com/cgi-bin/wiki?DataAndCodeAreNotTheSameThing http://www.c2.com/cgi-bin/wiki?DataAndCodeAreNotTheSameThing [3] - http://programmers.stackexchange.com/questions/136085/is-musical-notation-turing-complete http://programmers.stackexchange.com/questions/136085/is-mus...
- dragonwriter 13y ago> Musical notation which is obviously code for humans playing instruments (it even has loops, I think, AFAIR from my music lessons; don't know about conditionals; if it has them, maybe it's Turing-complete?). The are conditionals in standard music notation, at least ones that involve "executing different code" based on the value of a loop counter.