#

#x -- provides the length of a list, sequence, array or string, or the number of elements in a hash table or set.
x#i -- provides the value associated to the key i in the hash table x; or else the i-th element of x if x is a list, array, or sequence; or the i-th character of x if x is a string; or the value stored in the database x under the key i, which must be a string.

If x is a string, then i must be an integer, and x#i is the i-th character in the string, presented as a string of length one, or if i is out of range, a string of length zero is returned. If i is negative, then the i-th character from the end is provided.

Assignment to x#i can change the value if x is mutable.

The precedence of # when used as a binary operator is high, as high as . , but the precedence when used as a unary operator lower, as low as adjacency or function application.

     i1 = x = new MutableHashTable
     
     o1 = MutableHashTable{...}
     
     o1 : MutableHashTable
     
     i2 = x#i = p
     
     o2 = p
     
     o2 : Symbol
     
     i3 = x#i
     
     o3 = p
     
     o3 : Symbol
     

See also #? and #.

Go to main index.

Go to concepts index.