01_user_documentation:07_rgg_xl:02_xl:08_object:01_module:01_declaration:01_attributes_declaration
Attributes declaration
Attributes can be declared in :
- The list of typed arguments that follow the name
- As fields directly in the module body
Attributes declared in the the list of typed arguments are used implicitly for both: the constructor, and the pattern.
All attributes implicitly declare their accessors.
Attribute accessors are the methods to get and set the attribute value. The accessors of a Node are automatically resolved by the compiler with the syntax:
Sphere s; // has an attribute diameter s[diameter] = 5; // automatically resolve the setter float d = s[diameter]; // automatically resolve the getter
module A (float len); // is equiavent to: class A extends Node { float len; public A(float l) { len = l; } public static class Pattern extends UserDefinedPattern { private static void signature(@In @Out X node, float len ) {} } }
01_user_documentation/07_rgg_xl/02_xl/08_object/01_module/01_declaration/01_attributes_declaration.txt · Last modified: 2025/09/04 16:02 by gaetan
