Ampersand

From TinyMUX
(Redirected from &)
Jump to: navigation, 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
40px-Icon stickynote.gif Note: There is a simple way to create attributes that have both 'wizard' and 'hidden' attribute permission. Prefix the attribute name with an underscore (_) and the attribute can only be seen or edited by wizards.

Related Topics

@set, @attribute, attr_access, attr_alias, attribute permissions