Re: ediprolog -- Emacs does Interactive Prolog





On Dec 2, 9:57 pm, Markus Triska <tri...@xxxxxx> wrote:
"Richard Szopa" <ryszard.sz...@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).
[snip]
Does this work for you? What did you do to enter debug mode?

Basically, that's my problem--I did nothing to enter debug mode. It
just happened. ;-)

This problem is still present in the new version. Here's my session
with ediprolog (my comments are in angle brackets).

test(X) :- X=1.
%?- test(X).
%@% X = 1 a <Here I had to press a to get out of the debugger.>
%@% Yes


test2 :- print('123').
% ?- test2.
%@% 123
%@% Yes % <No problem here>


% ?- reverse([1,2,3,4], X).
%@% X = [4, 3, 2, 1]l
%@% Unknown action: l (h for help) <Return didn't work>
%@% Action? l
%@% Unknown action: l (h for help)
%@% Action? s
%@% Unknown action: s (h for help)
%@% Action? a
%@% Yes <Here I also had to press a to get out of the debugger.>

% ?- reverse([1,2,3,4,5], X).
%@% X = [5,4, 3, 2, 1]; <I pressed `;' and everything worked fine>
%@% No

% ?- print(a).
%@% a
%@% Yes <No problem here>

test3(1).
% ?- test3(X).
%@% X = 1;
%@% No

% ?- test3(1).
%@% Yes <OK>

It seems that there's a problem when you give Prolog an uninstantiated
variable and it has to assign some value to it. If

The rest of the problems I mentioned in my last post seem to be gone.

Anyway, when I took a look at the source of ediprolog I felt ashamed of
the dumb way I use Emacs (C-x C-f, C-x C-k, C-c C-b, C-x b, C-x C-s),
an that was an impulse for trying to learn at least some Emacs Lisp.
Thank you! ;)

Best wishes,

-- Richard

.