This might not be the right answer to your question, but: if an
"action" in the Deffunction has variables with the same names as the
arguments to the Deffunction, then when the action is invoked by the
Deffunction, it will get the actual values; i.e., this prints "5":
Rete engine = new Rete();
Deffunction xfunc = new Deffunction( "func", "comment" );
xfunc.addArgument( "n1", RU.VARIABLE);
xfunc.addArgument( "n2", RU.VARIABLE);
Funcall fc1 = new Funcall("+", engine);
fc1.arg(new Variable("n1", RU.VARIABLE));
fc1.arg(new Variable("n2", RU.VARIABLE));
xfunc.addAction( fc1 );
engine.addUserfunction(xfunc);
System.out.println(engine.eval("(func 2 3)"));
On Nov 19, 2008, at 11:46 AM, Wolfgang Laun wrote:
To build a deffunction by API calls, you use s.th. like
Deffunction xfunc = new Deffunction( "func", "comment" );
xfunc.addArgument( "arg",... );
Funcall fc1 = new Funcall(...);
fc1.arg( ... );
xfunc.addAction( fc1 );
And so on.
What I'd like to do is to pass all the parameters of the defined
function "func" to some Funcall within the body of that function.
I tried to use an RU.MULTIVARIABLE as a "func" argument and
pass that to the Funcall, but intrinsics don't seem to like that.
Is there a way to pass the multivariable as a single argument?
I can - vaguely - imagine that it's possible to call the API from
the composed
function using calls to (call) to build a Funcall that has as many
arguments as the multivariable contains simple variables, and
then call that function. But this seems to be a lot of effort for a
simple task.
Cheers
Wolfgang
---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.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]
--------------------------------------------------------------------