blob: 18b8765042c679104498257f87defa55015b729e [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 closure symbol_variable(string arg)
3 closure symbol_variable(symbol arg)
4 closure symbol_variable(int arg)
MG Mud User88f12472016-06-24 23:31:02 +02005
Zesstra715ec202025-07-09 22:18:31 +02006DESCRIPTION
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 User88f12472016-06-24 23:31:02 +020013
Zesstra715ec202025-07-09 22:18:31 +020014 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 User88f12472016-06-24 23:31:02 +020017
Zesstra715ec202025-07-09 22:18:31 +020018EXAMPLES
MG Mud User88f12472016-06-24 23:31:02 +020019 int base;
20 int var;
Zesstra715ec202025-07-09 22:18:31 +020021 symbol_variable("var") -> #'<this_object>->var
22 symbol_variable(0) -> #'<this_object>->base
MG Mud User88f12472016-06-24 23:31:02 +020023
Zesstra715ec202025-07-09 22:18:31 +020024HISTORY
25 Enabled since 3.2.1@8.
Zesstrad59c3892019-11-28 20:53:39 +010026
Zesstra715ec202025-07-09 22:18:31 +020027SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020028 lambda(E), quote(E), symbol_function(E)