3 ms·
I always have problems with the definition of homoiconicism... Prolog code is represented the same way as data, but (AFAIK) there is no functionality for manip
by marcosdumay 8y ago
I always have problems with the definition of homoiconicism...
Prolog code is represented the same way as data, but (AFAIK) there is no functionality for manipulating code at run-time or interpretation-time. I believe allowing macros is a necessary condition for homoiconicism, if I'm right, then Prolog isn't it.
- 3rdAccount 8y agoNo, I think just code is data is code right? Also, I'm not sure macros are needed for a language which doesn't do compilation.
- carapace 8y ago> there is no functionality for manipulating code at run-time or interpretation-time Sure there is: http://www.swi-prolog.org/pldoc/man?section=manipterm http://www.swi-prolog.org/pldoc/man?section=manipterm Example: ?- foo(Bar, Baz) =.. List. List = [foo, Bar, Baz]. And: ?- F =.. [foo, Bar, Baz]. F = foo(Bar, Baz).
- cjallen88 8y agoYou can do all that with term-rewriting in Prolog, you can use a grammar to parse a file of arbitrary text and transform it into prolog terms to be executed etc