MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | closure symbol_variable(string arg) |
| 3 | closure symbol_variable(symbol arg) |
| 4 | closure symbol_variable(int arg) |
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 an identifier (lfun) closure from the global |
| 8 | variable arg of the current program. The variable may be given as a |
| 9 | symbol, by name or by its ordinal number in the objects |
| 10 | variable table. |
| 11 | If there is no such variable, or if it is not visible outside |
| 12 | the object, 0 is returned. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 13 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 14 | If the argument is an integer, and the variable is inherited |
| 15 | and private in the inherited object (i.e. hidden), then a |
| 16 | privilege violation will occur. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 17 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 18 | EXAMPLES |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 19 | int base; |
| 20 | int var; |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 21 | symbol_variable("var") -> #'<this_object>->var |
| 22 | symbol_variable(0) -> #'<this_object>->base |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 23 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 24 | HISTORY |
| 25 | Enabled since 3.2.1@8. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 26 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 27 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 28 | lambda(E), quote(E), symbol_function(E) |