|
Folks,
On page 101 of the book Jess In Action an
alternative way to write a rule is given that seems to cause a parse error as
follows:
Jess> (clear)
TRUE Jess> (assert (letters b c)) <Fact-0> Jess> (defrule literal-values (letters (_data b c)) =>) Jess reported an error in routine Jesp.parsePattern. Message: Bad slot value . Program text: ( defrule literal-values ( letters ( at line 107. at jess.Jesp.a(Unknown Source) at jess.Jesp.a(Unknown Source) at jess.Jesp.if(Unknown Source) at jess.Jesp.do(Unknown Source) at jess.Jesp.int(Unknown Source) at jess.Jesp.for(Unknown Source) at jess.Jesp.parse(Unknown Source) at jess.Jesp.parse(Unknown Source) at jess.Main.execute(Unknown Source) at JessWin.jessExecute(JessWin.java:1115) at JessWin$63.run(JessWin.java:1062) at java.lang.Thread.run(Unknown Source) Jess> While
(defrule literal-values
(letters b c) =>) works fine.
Thoughts? Error in book code? Is that a
single underbar in front of "data" or two of them (I tried both ways and it
fails both ways)
Since the book specifically says the deftemplate is
implicit after the assertion of the ordered fact, one should not need to issue a
deftemplate for letters for this form to work, correct?
Mike
|
