A constructor definition.
A constructor may be either a callable constructor or a value constructor.
Examples (multi-line):
// 2D point shared new polar(r, φ) { Float r; Float φ; this.x = r * cos(φ); this.y = r * sin(φ); this.r = r; this.φ = φ; } shared new origin { x = 0.0; y = 0.0; r = 0.0; φ = 0.0; }
Anything
ConstructorDefinition
Declaration
Node
Object
Anything
Initializer |
ConstructorDefinition() |
Attributes | |
block | Source Codeshared formal Block block The block of the constructor. |
children | Source Codeshared formal <Annotations|LIdentifier|Parameters|ExtendedType|Block>[] children The child nodes of this node. Refines Node.children |
extendedType | Source Codeshared formal ExtendedType? extendedType The extended type of the constructor, if present. |
name | Source Codeshared formal LIdentifier? name The name of the constructor, if present. An absent name is only allowed for a callable constructor, in which case it is the default constructor. Refines Declaration.name |
parameters | Source Codeshared formal Parameters? parameters The parameters of the constructor, if applicable. Callable constructors have parameters, value constructors do not. |
Inherited Attributes |
Attributes inherited from: Declaration |
Attributes inherited from: Node |
Attributes inherited from: Object hash , string |
Inherited Methods |
Methods inherited from: Node |
Methods inherited from: Object equals |