Is it possible to do modifications to the toplevel of SWI Prolog?
Asked
Active
Viewed 110 times
-2
-
I'm not gonna bother explaining why I downvoted this, seems it should be obvious even to a newcomer : ] – m09 Feb 23 '12 at 22:13
1 Answers
5
Yes, in SWI-Prolog, the toplevel is implemented in Prolog in boot/toplevel.pl, you can use (a copy of) this as a starting point for extensions. It is sometimes useful to roll your own toplevel, for example, if you want to interact with the compiler via other tools such as editors and programming environments. Useful predicates to roll your own toplevel are atom_to_term/3, and read_term/2 especially with the variable_names option.

mat
- 40,498
- 3
- 51
- 78
-
1Thank you for the reply. This means that I implement a whole new toplevel. Is there a way to add to the existing toplevel or do I have to use it as it is? – user1220625 Feb 24 '12 at 13:49
-
I have been adding some prints to toplevel.pl but I do not see anything changing – user1220625 Feb 24 '12 at 13:58