Lost value.
- From: Trap D <joel.foutelet@xxxxxxx>
- Date: Tue, 06 Nov 2007 07:14:08 -0800
Hi everyone.
I use SWI-Prolog version 5.6.27.
Here is my code :
go :-
write('y or n : '),
read(X),
% Here I get what I wrote
writeln(X),
X == y, writeln(yes);
% Here, the value is lost
writeln(X), writeln(no).
Why do I obtain this ?
9 ?- go.
y or n : y.
before the test : y
yes
Yes
10 ?- go.
y or n : n.
before the test : n
after the test : _L129
no
When the test fails, I loose the value !
Can you explain please.
Thank you.
Yes
.
- Follow-Ups:
- Re: Lost value.
- From: Martin Riener
- Re: Lost value.
- From: Wit Jakuczun
- Re: Lost value.
- Prev by Date: Re: B-prolog : limited number of vars ?
- Next by Date: Re: Lost value.
- Previous by thread: B-prolog : limited number of vars ?
- Next by thread: Re: Lost value.
- Index(es):