Add support for indexers. Indexers are like properties but have any number parameters. These parameters are used to index the property value. This is used in sequences , tuples and maps and can be extented for other uses like matrices, for example.
Indexes are differentiated from properties because have no name and have parameters and from methods because parameters are enclosed in [ ] and not ( ). This acts as a mnemonic to how to invoke them.
Add support for indexers. Indexers are like properties but have any number parameters. These parameters are used to index the property value. This is used in sequences , tuples and maps and can be extented for other uses like matrices, for example.
String name = array[1]; Integer v = matrix[2, 3];
class Matriz {
private Array array = new Array(100);
constructor Matriz (maxRows: Integer, maxColumns : Integer);
public [row : Integer, col : Integer ] : Integer { get { return array [col + row * maxColumns ]; } set(value){ array [col + row * maxColumns ] = value; } } }
Indexes are differentiated from properties because have no name and have parameters and from methods because parameters are enclosed in [ ] and not ( ). This acts as a mnemonic to how to invoke them.