Sorry, ignore my last question. I figured out that using str-cat and
eval together can do what I want. I can run the example I sent using:
> (bind ?x "+")
"+"
> ?x
"+"
> (eval (str-cat "(" ?x " 1 2 3)"))
6
Very cool!
- Eithon
Eithon Cadag wrote:
Hi all,
Is binding a lambda function to a variable, and then using that
function, possible in Jess? I tried binding a lambda function to a
variable, and it seems like its binding, but am not sure how to call
the function or pass arguments. For example binding and checking a
variable with a lambda results in:
> (bind ?fnc (lambda (?y) (* ?y ?y)))
<UNKNOWN>
> ?fnc
<UNKNOWN>
but I'm not sure how to access or pass variables to that function. Is
my approach correct, or is what I'm doing not possible with Jess at
the moment?
Another question I have concerns the (eval) function. Its argument is
a string, but can I insert variables in the string? For example, is
there a way to do something like this:
> (bind ?x "AddNumbersFunc")
> (eval "(?x 1 2 3")
6
Any help (or roundabout ways of doing these things) is appreciated.
Thanks!
- Eithon
--------------------------------------------------------------------
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]
--------------------------------------------------------------------