pandita 1 min read

Attribute Initialisation

Words by gga

Previously, there were quite a few limitations on the expressions that could be used to initialise an attribute in an object. None of these limitations were mentioned in the overview (coming back soon,) but they existed nonetheless.

For example, you couldn’t initialise an attribute by reading from a database. There were quite a few restrictions on the functions that could be called during initialisation.

Initialising an attribute of an object, either a new attribute using is or by overriding on a mixin or inheritance (with(...) or using parent(...)), should now allow any expression. Including reading from a database. These initialisation expressions are collected together into a single anonymous function which is then called once at the very end of creating an object.

Objects are created either by being declared as the child of another object, or in a function with begin or using.