You can't, sorry. No execution context is carried from the LHS to the
RHS of a rule. If you need to do this kind of thing, you'll have to
move it to the rule's RHS; for example

  (defrule s_24_sendlinks-texts
        (send-links ?y)
        (web-page (URL ?y) (links-texts $?t) (links $?l))
        (knowledge-to-send      (name-other-agent ?a)
                                (terms-links-texts $?w))
        =>
        (if (> (length$ (bind $?x (search-in-list $?w $?t $?l))) 0)
                (insert-link ?a $?x)))


I think Fred Freitas wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
> 
> The rule
> 
> (defrule s_24_sendlinks-texts
>       (send-links ?y)
>       (web-page (URL ?y) (links-texts $?t) (links $?l))
>       (knowledge-to-send      (name-other-agent ?a)
>                               (terms-links-texts $?w))
>       (test (> (length$ (bind $?x (search-in-list $?w $?t $?l))) 0))
>       =>
>       (insert-link ?a $?x))
> 
> (insert-link is a function) has this parsing error:
> 
> ess reported an error in routine ReteCompiler.eval.
>   Message: Unbound variable found in funcall: x parsing defrule
> s_24_sendlinks-texts .
>   Program text: ( defrule s_24_sendlinks-texts ( send-links ?y ) ( web-page
> ( URL ?y ) ( links-texts $?t ) ( links $?l ) ) ( knowledge-to-send
>  name-other-agent ?a ) ( terms-links-texts $?w ) ) ( test ( > ( length$
>  bind $?x ( search-in-list $?w $?t $?l ) ) ) 0 ) ) = > ( insert-link ?a
> $?x ) )  at line 25.
>       at jess/ReteCompiler.compilerError
>       at jess/ReteCompiler.eval
>       at jess/ReteCompiler.eval
>       at jess/ReteCompiler.eval
>       at jess/ReteCompiler.addRule
>       at jess/Rete.addDefrule
>       at jess/Jesp.doParseDefrule
>       at jess/Jesp.parseDefrule
>       at jess/Jesp.parseSexp
>       at jess/Jesp.parse
> 
> How do I bind a Value in the LHS to use it in the RHS? I also tried ?x
> instead of $?x.
> 
> Thx in advance
> 
> Fred Freitas
> ----------------------------------------------------------
> PhD. student - Artificial Intelligence & Internet
> Universidade Federal de Santa Catarina - Brasil
> Currently at University of Karlsruhe - Germany
> 
> 
> 
> ---------------------------------------------------------------------
> 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]
---------------------------------------------------------------------

Reply via email to