Exiting consult mode

Consult mode is used to enter facts and predicates at the top level.

?- [user].
|: likes(mary, john).
|: end_of_file.

Many times you will see ^D (Ctrl-D) use to exit consult mode, however end_of_file. will also work and be less confusing.

True, but is it more typing :frowning: IMHO, consulting user is hardly ever a good idea. If you just want to add a single simple clause, use assertz/1. Else create a file and load it. That is much easier to handle, in particular if you find you made a mistake and want to correct the code.

I agree.

Lately I am seeing more responses, here and on other sites, that are using the consult mode to enter data and then using ^D to exit consult mode. For those new to coding and entering code, the ^D has them very confused. :slightly_smiling_face: