Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Swi threads

0 views
Skip to first unread message

Brock Jenson

unread,
Nov 4, 2009, 8:06:05 PM11/4/09
to
I am new to Prolog and recently started using it's thread capability.
The manual says when messages are sent between threads the bindings
are lost. When I try to send some term from one thread to another and
try to print out the term in the receiving thread, I just get
something like _L98... How do I get Prolog to re-bind the value so
output displays the original message?

Jan Wielemaker

unread,
Nov 5, 2009, 10:28:05 AM11/5/09
to

I suspect you are talking about toplevel interaction. Prolog itself has
no notion about variable names whatsoever. Only the toplevel tries to be
a bit kind by finding the names you gave to the variables and reuse
these names when printing the results.

If you use a thread, you get new variables there. Only some tickery you
probably do not want to know about as a beginner can change that (roughly,
sending the answer back and have the toplevel unify the answer with the
original variables).

Cheers --- Jan

0 new messages