Re: assigning constant to variable



Hello,

just found a way to do this.

findname(X, 0, [X|S).

Thanks.

none wrote:

Hello,

What's the way to assign a constant value to a variable?

ERROR: is/2: Arithmetic: `lady/0' is not a function

This is after calling a functor like

/*
R is result,
P is position,
S is set
*/

findname(R, 0, [X|S]) :-
R is X.

The set is filled with constants. Example:

[lady, in, red]

Thanks.
.