Beginner's problem with ;

29 views
Skip to first unread message

Lawrence Bottorff

unread,
Jan 26, 2017, 10:32:13 PM1/26/17
to SWI-Prolog
I'm sure there's a simple explanation, but I can't get ; to behave as advertised. I'm going through the first page of Learn Prolog Now! and it gives this example:
 
woman(mia).
woman(jody).
woman(yolanda).
loves(vincent,mia).
loves(marsellus,mia).
loves(pumpkin,honey_bunny).
loves(honey_bunny,pumpkin).

Then it talks about variables. The statement

?- woman(X). 

gives

?- woman(X).
woman(X).
X = mia

but when I enter ; and return it gives this

X = mia ;
;
X = jody .
?-

In other words, it seems to kick me out to the prompt without giving me the opportunity to enter ; again and get yolanda. I'm on  SWI 7.4.0 on Ubuntu16.10. What am I missing here?

Lawrence Bottorff

unread,
Jan 27, 2017, 8:16:03 AM1/27/17
to SWI-Prolog
It turns out that this behavior is happening only on my Emacs prolog mode, and not in a regular terminal. I have Emacs' elpa version 1.22, which says it's "shadowing a built-in package." Will complain to TBTB.

Martin Sondergaard

unread,
Jan 27, 2017, 5:45:20 PM1/27/17
to swi-p...@googlegroups.com
Lawrence Bottorff wrote:
but when I enter ; and return it gives this

X = mia ;
;
X = jody .
?-

In other words, it seems to kick me out to the prompt without giving me the opportunity to enter ; again and get yolanda. I'm on  SWI 7.4.0 on Ubuntu16.10. What am I missing here?

You only need to press one key, ";".
There is no need to press "Enter".

When you pressed "Enter", this made it return to the "?-" prompt.


By the way, I prefer to press "space" rather than ";".

--
Martin Sondergaard.
Reply all
Reply to author
Forward
0 new messages