help!: stuck in prompt

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

help!: stuck in prompt

Samer Abdallah-3
Hello,
My Prolog session is stuck waiting for input with a ‘pipe’ prompt (ie |)
and I can’t get out of if. It started like this:

?- X = (a || b).
|    .
|    |.
|    Action (h for help) ? abort
|    
|    /
|    .
|    .
|    ||
|    
|    .
|    '
|    '
|    "”
|

% … etc …

I tried Ctrl-c and abort but I couldn't escape from the  | prompt.
1) How do I get out?
2) Could we have option to the Ctrl-C menu (ie a:abort, e:exit etc) to escape from the
   current prompt?

Samer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.iai.uni-bonn.de/pipermail/swi-prolog/attachments/20140904/bc711bdf/signature.asc>
_______________________________________________
SWI-Prolog mailing list
[hidden email]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help!: stuck in prompt

Jan Wielemaker-5
On 09/04/2014 01:08 PM, Samer Abdallah wrote:

> Hello,
> My Prolog session is stuck waiting for input with a ‘pipe’ prompt (ie |)
> and I can’t get out of if. It started like this:
>
> ?- X = (a || b).
> |    .
> |    |.
> |    Action (h for help) ? abort
> |    
> |    /
> |    .
> |    .
> |    ||
> |    
> |    .
> |    '
> |    '
> |    "”
> |
>
> % … etc …
>
> I tried Ctrl-c and abort but I couldn't escape from the  | prompt.
> 1) How do I get out?

Typing `|}`.  It should be easier though :-(  Actually, you should not
get in
there.

> 2) Could we have option to the Ctrl-C menu (ie a:abort, e:exit etc) to escape from the
>    current prompt?

Would be nice.  Just, Ctrl-C handled totally different in the various
versions with different implementations of input editing.  It is hard
to make promises that will hold for all versions :-(

A fairly generic way to get out is by using end-of-file (most often
Ctrl-D).  If nothing is read, this will cause Prolog to stop due to
end-of-file.  If something has been read and you don't know what it is
waiting for, it will cause an `Unexpected end of clause` exception and
resume the toplevel.

Maybe we could have different continuation prompts, depending on what
it is waiting for?  Not sure how easy it would be to implement that.
Might also be hard to find a good syntax for showing that.  Basically,
it can be inside bracketed input, quoted input or quasi-quoted input
or nothing at all, waiting for the fullstop.

        Cheers --- Jan
_______________________________________________
SWI-Prolog mailing list
[hidden email]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
Loading...