MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | 0c773a7 | 2017-06-25 11:52:33 +0200 | [diff] [blame] | 2 | closure symbol_function(symbol arg) |
| 3 | closure symbol_function(string arg) |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 4 | closure symbol_function(string arg, object|lwobject|string ob) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 5 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 6 | DESCRIPTION |
| 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 12 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 13 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 18 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 19 | Private lfuns can never be accessed this way, static and |
| 20 | protected lfuns only if <ob> is the current object. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 21 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 22 | EXAMPLES |
| 23 | symbol_function("efun::users") -> #'users |
| 24 | symbol_function("QueryProp", other_obj) -> other_obj->QueryProp() |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 25 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 26 | HISTORY |
| 27 | Introduced in 3.2@70. |
Zesstra | 0c773a7 | 2017-06-25 11:52:33 +0200 | [diff] [blame] | 28 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 29 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 30 | lambda(E), quote(E) |