Ampersand
Jump to navigation
Jump to search
The ampersand symbol (&) is a special shorthand for the attribute-setting form of @set with some magical behavior.
It is typically used to set user-defined attributes on objects, like this:
- &TEMPERATURE reactor = cool
The Temperature attribute on the reactor object is set to the value cool.
& behaves differently than @set when it is typed by a player directly through their socket (as opposed to run by a player or other object through the MUSH's queue). In this case, the value on the right-hand side of the equal sign is stored without any evaluation. These examples illustrate the difference:
- &SUM calculator = [add(1,1)]
- (calculator/SUM now contains '[add(1,1)]' )
- @set calculator = SUM:[add(1,1)]
- (calculator/SUM now contains '2' )
The ampersand symbol is also used to generate compound locks as the AND operator.
For example, an unpassable default lock. @lock me=me&!me
Related Topics
@set, @attribute, attr_access, attr_alias, attribute permissions