Hi,

You can't do pattern matching inside of deffunctions, only inside of
defrules and defqueries. You could recast this as a rule like

  (defrule  esborraSortir 
   ?e <- (esborraSortir ?numero ?pal)
   ?fact <- (sortir (str-cat ?numero "-" ?pal) ?) 
   =>
   (retract ?e ?fact))

and then to use it you could do this:

  (assert (esborraSortir 5 ors))
  (run)

I think Jordi Cardona wrote:
> Hi all,
> 
> Excuse my poor english, please.
> 
> I have a question about use facts in deffunction, I explain me with an
> example
> 
> (deffunction esborraSortir (?numero ?pal)
>    ?fact <- (sortir (str-cat ?numero "-" ?pal) ?)
>    (retract ?fact)
> )
> 
> In my knowledge base, I have facts like:
> 
>     (sortir "5-ors" 5)
> 
> When I execute:
> 
>     (esborraSortir 5 ors)
> 
> Jess don't work and answer:
> 
>      Jess reported an error in routine Variable.resolveValue while
>      executing deffunction esborraSortir while executing
>      (esborraSortir 5 ors).
>      Message: Undefined variable (no binding) fact.
>      Program text: ( esborraSortir 5 ors )  at line 0.
>      Undefined variable (no binding)
> 
> It's possible to use question mark (?) in this case?
> 
> Thanks for answers or comments
> 
> Jordi Cardona
> 
> 
> ---------------------------------------------------------------------
> 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