Try this:
?- X = cat, assert(sleeps(X)).
?- sleeps(Z).
Z = cat.
SWI doesn't bother to show Z=Z, and as for the predicate sleeps, it takes a parameter, and that works somewhat like regular languages: It doesn't represent a memory location, but something that gets instantiated when you call it.
Alan Baljeu
----- Original Message ----
From: metaperl.j <
metaperl.j@...>
To:
swi-prolog@...
Sent: Fri, October 23, 2009 2:59:06 PM
Subject: [SWIPL] binding variables to variables
If I assert the fact:
assert(sleeps(X)).
and then query it:
[debug] ?- sleeps(Z).
Yes
Why do I not see the memory location shared between the query and the fact,
e.g:
Z = _f5ehaa23
--
View this message in context:
http://www.nabble.com/binding-variables-to-variables-tp26031617p26031617.htmlSent from the SWI Prolog mailing list archive at Nabble.com.
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo..cgi/swi-prolog __________________________________________________________________
Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at
http://downloads.yahoo.com/ca/internetexplorer/_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog