From <http://herzberg.ca.sandia.gov/jess/docs/70/deffunctions.html>: "Normally a deffunction takes a specific number of arguments. To write a deffunction that takes an arbitrary number of arguments, make the last formal parameter be a multifield -- a variable prefixed with a '$' character. When the deffunction is called, the multifield variable will contain all the remaining arguments passed to the function, as a list. A deffunction can accept no more than one such wildcard argument, and it must be the last argument to the function."
Bob Kirby At 08:29 AM 5/21/2007, NicolasF wrote: >Hello everybody, > >I want to implement a custom printout function which looks like this: > >(deffunction printOut (?message) > (printout t ?message) ;; Default router > (printout file ?message) ;; My custom router >) > >"file" is a custom router which is printing the ?message variable in a text >file. The ?message can contain many expressions, e.g.: >(printOut "value of x is " ?x crlf "value of y is " ?y crlf) > >Unfortunately only the first expression in the message is printed out. So in >the previous example, the print out would be: >"value of x is " > >Instead of: >"value of x is 0" >"value of y is 1" > >I tried to concatenate the message's expressions with (str-cat <expression>*) >but now the crlf are missing. So the output looks like this: >"value of x is 0 crlfvalue of y is 1crlf" > >What is the simplest solution to my problem? Do I have to parse each >expression in the ?message variable? > >Best regards, > >NicolasF >-------------------------------------------------------------------- >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] >--------------------------------------------------------------------
