Re: ediprolog -- Emacs does Interactive Prolog
- From: Markus Triska <triska@xxxxxx>
- Date: Sat, 02 Dec 2006 21:57:07 +0100
"Richard Szopa" <ryszard.szopa@xxxxxxxxx> writes:
For example, if I write in a buffer something like this:
?- reverse([1,2,3], X).
and press <f10>
it outputs
%@% X = [3, 2, 1]
and directly enters the debugger (as I understand, this isn't an
intended behavior).
That's indeed not intended -- F10 on
?- reverse([1,2,3], X).
gives:
?- reverse([1,2,3], X).
%@% X = [3, 2, 1]
You then interact as on a terminal. Pressing ";" gives:
?- reverse([1,2,3], X).
%@% X = [3, 2, 1] ;
%@% No more solutions.
Does this work for you? What did you do to enter debug mode?
example
?- reveraaaaaaaaaaaaaaaaaaaaaaaaaaase([1,2,3], X).
it says
%@% Error: Undefined procedure: reveraaaaaaaaaaaaaaaaaaaaaaaaaaase/2
gives the message `press h for help.', but now Emacs is hanged, at
least until I manually kill the Prolog process.
You can always get out of such hangs with Ctrl + g in Emacs. While a
restart of the Prolog process isn't necessary in this case (since SWI
is already on the toplevel again, see below), you can always terminate
the background process with Ctrl+0 F10 (numeric argument zero for F10)
and automatically get a new one with the next press of F10.
Reason for the hang: Such an error takes SWI back to the toplevel,
whereas ediprolog thinks the output is just the result of your query
and waits for key presses (like ";" and "a") that are then sent to SWI
and meaningless to it on the toplevel. I currently don't check for
"Error:" in query output since it's prone to false positives. If
anyone needs a more specialised version for teaching environments, I
will provide one.
and on some other line press <f10> two times, then emacs hangs, and
killing prolog doesn't help much. What is more, I figured out that
I could reproduce this and have made a change that fixes the problem
for me. Please try the latest version from
http://stud4.tuwien.ac.at/~e0225855/ediprolog/ediprolog.html
Thank you for your feedback, and best wishes!
Markus Triska
.
- Follow-Ups:
- Re: ediprolog -- Emacs does Interactive Prolog
- From: Richard Szopa
- Re: ediprolog -- Emacs does Interactive Prolog
- From: Jan Wielemaker
- Re: ediprolog -- Emacs does Interactive Prolog
- References:
- ediprolog -- Emacs does Interactive Prolog
- From: Markus Triska
- Re: ediprolog -- Emacs does Interactive Prolog
- From: Richard Szopa
- ediprolog -- Emacs does Interactive Prolog
- Prev by Date: Re: ediprolog -- Emacs does Interactive Prolog
- Next by Date: comp.lang.prolog Frequently Asked Questions
- Previous by thread: Re: ediprolog -- Emacs does Interactive Prolog
- Next by thread: Re: ediprolog -- Emacs does Interactive Prolog
- Index(es):