Next: , Previous: , Up: Expressions   [Contents][Index]

6.1 Variables

A variable is a name to which a value can be assigned. In LUX, whenever you assign a value to a variable, the variable takes on the data class and type of the value you assigned to it (with the exception of pointer variables (see Pointers). So, the set of assignments

x = 17.3
x = 'Jabberwocky'

first makes variable x be a float, and then a string.

Names of variables must start with a letter or one of the characters $ ! #. Following characters in the names of variables must be letters, digits, or the character _. Variables are either local or global.

Reserved keywords cannot be used as names of variables.