You've neglected to read section 8.9 of the manual, where the (=)
function is documented: the arguments must be numeric. There are
plenty of other ways to compare Strings, though. Given two variables
pointing to atoms, any of
(str-compare ?y ?z)
(eq ?y ?z)
(eq* ?y ?z)
(and potentially many others) can be used to compare them in some way
or another. Consult the manual for detailed documentation on each of
these options.
I think Jed Padilla wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> given code like this
>
> (deffacts initial
> (ct Anna 1)
> (ct Billy 2)
> )
> ....
> (ct ?z ?zt)
> (ct ?y&~?z ?yt)
> ....(small excerpt)
>
> I am trying to compare later in the program if these letter are equal (I am
> using more than just these two)
> I tried a simple
> (if (= ?z ?y))
> then
> printout
> else
> printout
>
> and that didn't work, it wouldn't let me do a str-compare. I was wondering
> if there was a simple way to do this. The only other idea I had was to
> check the values
> (if (= ?zt ?yt))
> then
> printout
> else
> printout
>
> any ideas?
>
> I was also wondering if there is a way to retract a rule, like we would a
> fact.
>
> Jed
>
>
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list (use your own address!) List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------