Thanks for your help, but it didn't work.
Jess reported an error in routine Jesp.parsePattern.
Message: Expected '( <atom>' .
Program text: ( defrule colorsee ( color $?color) ( ( at line 4.
at jess.Jesp.parseError(Jesp.java:1450)
at jess.Jesp.parsePattern(Compiled Code)
at jess.Jesp.doParseDefrule(Compiled Code)
at jess.Jesp.parseDefrule(Jesp.java:865)
at jess.Jesp.parseSexp(Jesp.java:153)
at jess.Jesp.parse(Compiled Code)
at jess.Main.execute(Compiled Code)
at jess.Main.main(Main.java:26)
This is code:
(assert (color (create$ red green blue)))
(defrule colorsee
(color $?colors)
((bind ?element (nth$ 2 $?colors)) green)
=>
(printout t "colors 2: " (bind ?element (nth $2 $?colors)) crlf)
(printout t " list :" $?colors crlf))
Vera
Venkatachalam Kanthim wrote:
> hi:
>
> I recall having this problem before.
>
> Try (nth$ 2 $?colors) instead of (nth $2 $?colors). Guess this a
> slight difference in notation from CLIPS.
>
> Hope it works.
>
> ---
> Venkat
>
> In message <[EMAIL PROTECTED]>you write:
> >
> >Hello List
> >
> >I'm sorry for the primary questions, but given the following list. As to
> >verify the color of the 2nd element of the list.
> >(assert (color (create $red green blue)))
> >
> >(defrule colorsee
> > (color $?colors)
> > ((bind ?element (nth $2 $?colors)) green) ---> it gives
> >mistake...
> > =>
> > (printout t "colors 2: " (bind ?element (nth $2 $?colors)) crlf)
> > (printout t " list :" $?colors crlf))
> >
> >---------------------------------------------------------------------
> >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]
> >v.
> >---------------------------------------------------------------------
---------------------------------------------------------------------
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]
---------------------------------------------------------------------