If you call apply with str-cat outside of a function, the result is what you would expect: a single string that is the argument strings concatenated.

 

Jess> (apply str-cat “foo” “ bar” “ baz”)

“foo bar baz”

 

If you declare a function that performs the concatenation on its single multifield argument, the result of the apply inside the function is a string with the original quotes preserved:

 

Jess> (deffunction test ($?args) (apply str-cat ?args))

TRUE

Jess> (test "foo" " bar" " baz")

"\"foo\" \" bar\" \" baz\""

 

To concatenate strings inside a function currently I use a foreach loop:

 

(bind ?res "")

(foreach ?str ?args (bind ?res (str-cat ?res ?str)))

 

where ?args is the multifield parameter of the function as above.

 

Bug? Or am I not understanding something?

 

Thanks,

 

Steve Solomon

Institute for Creative Technologies

University of Southern California

solomon “at” ict.usc.edu

 

 

Reply via email to