blob: 25900ab8a2e26e59a4ecaf50d3220cf921d356a9 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 mixed funcall(closure cl, mixed arg ...)
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstra715ec202025-07-09 22:18:31 +02004DESCRIPTION
5 Evaluates the closure. The extra args will be passed as args
6 to the closure. If cl is not a closure, it will simply be
7 returned.
MG Mud User88f12472016-06-24 23:31:02 +02008
Zesstra715ec202025-07-09 22:18:31 +02009EXAMPLES
10 mixed eval(object ob, string func, mixed *args)
11 {
12 return funcall(#'call_other, ob, func, args);
13 }
Zesstrad59c3892019-11-28 20:53:39 +010014
Zesstra715ec202025-07-09 22:18:31 +020015 This will result in calling
16
17 ob->func(args).
18
19 In combination with the '...' operator, the functionality
20 of apply() can be implemented:
21
22 mixed eval(object ob, string func, mixed *args)
23 {
24 return funcall(#'call_other, ob, func, args...);
25 }
26
27 will result in calling
28
29 ob->func(args[0],args[1],...,args[sizeof(args)-1]).
30
31HISTORY
32 Introduced in 3.2@70.
33 Returning a non-closure as it is even when args are given was
34 introduced with 3.2.1.
35
36SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020037 apply(E), quote(E)