Skip to main content

INDEX_READ

Constant INDEX_READ 

Source
pub const INDEX_READ: &str = "[]";
Expand description

The catalog name of the subscript read m[key].

A subscript is dispatched on the receiver’s shape and its arity exactly as a method is — grid[x, y] is Grid[T] at arity two, m[key] is Map[K, V] at arity one — so it is a catalog row rather than a second dispatch table. The spelling is not an identifier, which is what keeps it out of source: the parser only accepts an Ident after ., so m.[](k) cannot be written, and nothing in the language can name these rows except the subscript grammar.