[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: variable heads of terms
From: |
Henk Vandecasteele |
Subject: |
Re: variable heads of terms |
Date: |
Tue, 14 Feb 2006 22:39:14 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) |
Cliff,
you need the =.. operator:
| ?- X = reads, FACT =.. [X,tom, book] .
FACT = reads(tom,book)
X = reads
yes
| ?-
Regards,
Henk
Cliff Bender wrote:
Hello
I'd like to be able to do something like the following:
X=reads, FACT=X(tom,book).
is there anything that will allow me to do this? Unfortunately, the
previous code gives the following error:
| ?- X=reads, FACT=X(tom,book).
uncaught exception: error(syntax_error('user_input:12 (char:16) . or
operator expected after expression'),read_term/3)
Thanks for any help you can provide!
CB
_______________________________________________
Users-prolog mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/users-prolog
--
Henk Vandecasteele
Katholieke Universiteit Leuven Dept. Computer Science
Celestijnenlaan 200A, B-3001 Leuven, Belgium
E-mail: address@hidden