Hello everybody!

Assume i have the following function:
   
   (deffunction my_member (?val ?list)
        "implementation for member-predicate in jess"
        (
        (printout t (length$ (list ?list) ))
        ;(foreach ?element ?tail (printout t ?element))   
    ))

I tried to call the function using Jess70p1 like this:

1. (my_member 3 (list 1 2 3 4))
Result: (my_member 3 (list 1 2 3 4))
Jess reported an error in routine call
        while executing (call (printout t (length$ (list ?list))))
        while executing deffunction my_member
        while executing (my_member 3 (list 1 2 3 4)).
  Message: Not enough arguments . <= Hmm okey what function did ACTUALLY
fail? length$, list, printout?
  Program text: ( my_member 3 ( list 1 2 3 4 ) )  at line 56.

2. (my_member 3 (1 2 3 4))
Jess reported an error in routine Jesp.parseFuncall.
  Message: "1" is not a valid function name at token '1'.
  Program text: ( my_member 3 ( 1  at line 57.
Jess> 2
Jess> 3
Jess> 4
Jess> Jess reported an error in routine Jesp.parseExpression.
  Message: Expected a '(', constant, or global variable at token ')'.
  Program text: )  at line 57.
Jess> Jess reported an error in routine Jesp.parseExpression.
  Message: Expected a '(', constant, or global variable at token ')'.
  Program text: )  at line 57.

Now my question is: How do i call a function with a list as parameter?

Regards,

Christoph
-- 
View this message in context: 
http://www.nabble.com/how-to-correctly-call-a-function-which-has-a-list-as-parameter-tf3468987.html#a9679650
Sent from the Jess mailing list archive at Nabble.com.

--------------------------------------------------------------------
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