blob: 177fdac55068bc3073f4724d3bc9203903d1b0b1 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra0c773a72017-06-25 11:52:33 +02002 closure symbol_function(symbol arg)
3 closure symbol_function(string arg)
Zesstra715ec202025-07-09 22:18:31 +02004 closure symbol_function(string arg, object|lwobject|string ob)
MG Mud User88f12472016-06-24 23:31:02 +02005
Zesstra715ec202025-07-09 22:18:31 +02006DESCRIPTION
7 Constructs a lfun closure, efun closure or operator closure
8 from the first arg (string or symbol). For lfuns, the second
9 arg is the object that the lfun belongs to, specified by
10 the object itself or by its name (the object will be loaded
11 in the second case)
MG Mud User88f12472016-06-24 23:31:02 +020012
Zesstra715ec202025-07-09 22:18:31 +020013 If the closure is created for an lfun in an object other than
14 the current object, the result is an 'alien lfun closure'. Such
15 closures are bound to the object executing the symbol_function()
16 (this is what to_object() will return), even though the actual
17 code is in that other object (which get_type_info() will return).
MG Mud User88f12472016-06-24 23:31:02 +020018
Zesstra715ec202025-07-09 22:18:31 +020019 Private lfuns can never be accessed this way, static and
20 protected lfuns only if <ob> is the current object.
MG Mud User88f12472016-06-24 23:31:02 +020021
Zesstra715ec202025-07-09 22:18:31 +020022EXAMPLES
23 symbol_function("efun::users") -> #'users
24 symbol_function("QueryProp", other_obj) -> other_obj->QueryProp()
MG Mud User88f12472016-06-24 23:31:02 +020025
Zesstra715ec202025-07-09 22:18:31 +020026HISTORY
27 Introduced in 3.2@70.
Zesstra0c773a72017-06-25 11:52:33 +020028
Zesstra715ec202025-07-09 22:18:31 +020029SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020030 lambda(E), quote(E)