/doc/efun/apply


SYNOPSIS

mixed apply(closure cl, ...)

DESCRIPTION

Evaluates the closure.

One might wonder why there are two functions, funcall() and apply(), to perform the seemingly same job, namely evaluating a closure. Of course there is a subtle difference. If the last argument to apply() is an array, then each of its elements gets expanded to an additional paramater. The obvious use would be #'call_other as in

	mixed eval(object ob,string func,mixed *args)
	{
	  return apply(#'call_other,ob,func,args);
	}
This will result in calling
	ob->func(args[0],args[1],...,args[sizeof(args)-1]).
Using funcall() instead of apply() would have given us ob->func(args).

HISTORY

Introduced in 3.2@70

SEE ALSO

funcall
closures

| Home | Applied | Concepts | Efuns | Help | Intro | Lib | LPC | Prop | Obj | Sefuns | Std | W |

Nightfall@quest.tat.physik.uni-tuebingen.de
Automatically generated on Don, 11. Apr 1996