Re: JESS: Defrule bind get-member crashes: Bad slot value at token '('.

"Wolfgang Laun" <[email protected]> Fri, 4 Mar 2011 13:31:39 +0100
Newsgroups gmane.comp.java.jess
Message-ID <1406_1299242130_p24CYnJx002956_AANLkTimF5DL8FrhuD_Sm-Ga+JA+pKL_8ZeTKXLt7w=Cs@mail.gmail.com>
On 4 March 2011 08:18, Jevon Wright <[email protected]> wrote:

>  But I am having trouble with accessing members
> of the elements, using either get-member, or call, or bind.
>
> (defrule debug-three
>        ?container <- (BooleanPropertyImpl)
>        (bind ?name (get-member ?container name))
>

You cannot use a function call on the left hand side.



>        =>
>

It should be fine here in the consequence.


>        ((System.out) println "Found name:")
>        ((System.out) println ?name)
> )
>
> The reason I am using get-member is that I was trying to see if an
> elements' List contains another element:
>
> (defrule debug-four
>        ?property <- (BooleanPropertyImpl)
>        ?container <- (PageImpl)
>

You can also move the arrow up ;-)
=>


>        (bind ?children (get-member ?container children)))
>        (member$ ?property ?children)
>
[snip]
-W

>        ((System.out) println "...")
> )
>
> However, this also fails with the exception above. Any ideas or
> suggestions would be most welcome. :)
>
> Thanks
> Jevon