Show quoted text> Sorry, last one (I hope). I'm only reporting this because in the PBP,
> you talk about building an API that behaves like one would expect.
Yes, but I also talk about not allowing variables to go uninitialized.
Show quoted text> If one uses the "init_arg" tag, that attribute becomes required at instantiation.
> I would expect it to be optional. If not supplied that attribute is undefined.
I consciously chose to make such arguments required, so the user is...
Show quoted text>...forced to do:
>
> my %name : ATTR( :init_arg<name> :get<name> :default<undef> );
>
In other words if you specify that an attribute can be initialized, I want you
to be explicit about what should happen if it isn't.
I can certainly see your point about expectations, but that convenience has to
be balanced with the desirability of being explicit about default behaviours.
I chose to require explicitness (because I believe that improves the
robustness of the resulting code).
All the best,
Damian