Primary expressions (ref)
From Nemerle Homepage
Contents |
Primary expressions
Primary expressions are a grammar category referring to expressions that have a closed structure and are otherwise simple. Primary expressions and plain expressions do not differ at the semantic level.
this expression can only be used within non-static methods and indicates a reference to the current instance of the class (which posses this method).
Expression like this.foo can be shortened to foo unless it would generate an identifier ambiguity with some variable being in this lexical scope.
The this keyword can be also used to call instance constructor from another constructor.
base expression can only be used within non-static methods and indicates a reference to the current instance of the class coerced to the type of the base class. Calls made on base pointer are non virtual.
The base keyword can be also used to call instance constructor of base class from another constructor.
Grouping expression
A grouping expression allows to enforce particular syntax decomposition
of expression.
Member reference
This expression allows referring to the field or method that the object
represented by primary_expr contains.
Tuple constructor
The type of that tuple is type_1 * ... * type_n where type_1 and the
following are types of corresponding expressions.
Indexer reference
This expression allows to refer to indexed (even by multiple indexes)
fields of objects represented by leftmost expr where second (and further)
expr are indexes values of the field we want to refer to. expr must
refer to object with an indexer defined. This includes arrays, strings,
hashtables and other collections.