On Tue, Dec 30, 2008 at 1:29 PM, serendipity <[email protected]
> wrote:
> Here i have a deftempate :
>
>  (deftemplate mitsos (slot x (type INTEGER)) )
>
> and i created a rule
>
>    (defrule myrule (mitsos(x (+ ?n 1)))
>    =>
>    (printout t "everything is ok" ))

(1) You must use global variables in the patterns of a rule. These
have funny names - note the two asterisks - and are defined like this:
   (defglobal ?*n* = 1)

(2) A pattern that tests for the equalitiy of a slot's value to some
expression is written like this:
  (defrule myrule
     (mitsos (x = (+ ?*n* 1)))
  =>
     ...

(3) A few line ends at all the right places make for better reading
of a mail, don't you think so ;-)

-W




On Tue, Dec 30, 2008 at 1:29 PM, serendipity <[email protected]
> wrote:

> hello!(sorry about my bad english) I am working first time with jess and i
> have some problems Here i have a deftempate : (deftemplate mitsos (slot x
> (type INTEGER)) ) and i created a rule (defrule myrule (mitsos(x (+ ?n 1)))
> => (printout t "everything is ok" )) although,the jess tell me that i have
> syntax error at (x (+ ?n 1))) how can i write it in appropriate way? plz
> help me!!!!
> ------------------------------
> View this message in context: Problem with variables and rule 
> syntax<http://www.nabble.com/Problem-with-variables-and-rule-syntax-tp21216604p21216604.html>
> Sent from the Jess mailing list 
> archive<http://www.nabble.com/Jess-f2643.html>at Nabble.com.
>

Reply via email to