Re: help!: stuck in prompt
Jan Wielemaker <[email protected]> Sun, 7 Sep 2014 11:03:26 +0200
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 09/04/2014 01:08 PM, Samer Abdallah wrote: > Hello, > My Prolog session is stuck waiting for input with a =91pipe=92 prompt (ie= |) > and I can=92t get out of if. It started like this: > = > ?- X =3D (a || b). > | . > | |. > | Action (h for help) ? abort > | = > | / > | . > | . > | || > | = > | . > | ' > | ' > | "=94 > | > = > % =85 etc =85 > = > 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 es= cape 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