Clarify when BUILD applies default values to attributes#4774
Clarify when BUILD applies default values to attributes#4774schultzdavid wants to merge 1 commit intomainfrom
Conversation
The current phrasing ("All attributes that have not been touched in any of the previous steps") is ambiguous, since "any" might be understood as including all runs of the parent classes' bless method.
So maybe just be explicit and say “in this sub class”? |
|
I think now that the best solution is to add a new bullet point to the list of "Implications" right below, between what are currently the second and third bullet points (i.e. between the ones that begin with "Custom BUILD methods should always..." and "BUILD may set an attribute, but..."). In this new point one can then say explicitly that parent attributes are not exactly overwritten, rather being still accessible per In addition, as the very first of all the bullet points of the section, one should probably add one that mentions the declaration and initialization of attributes declared by the child class (which takes place before This is all essentially specced in roast S12-methods/accessors.t lines 54–69. I'll see to write something soon-ish. |
https://docs.raku.org/language/objects#Object_construction
The current phrasing ("All attributes that have not been touched in any of the previous steps") is ambiguous, since "any" might be understood as including all runs of the parent classes' bless method. Thus, change wording to "not been touched in the previous two steps". The added remark "(overriding any parent attributes of the same name)" makes this even more explicit.
I'm a bit on the fence about the wording "override" though, since the parent class itself retains its attribute intact; the child class's attribute merely "eclipses" it: