Of course, if you prefer to return undef in that case, you can have that, too: All you need to know is that stuff you used to write in the body of new now goes into the ADJUST phaser.
How? How do you prevent your OO system from throwing in case a mandatory parameter is missing and convince it to return undef instead? How do you convince it to return undef from within an ADJUST whateverscifiweaponyoudecidetocallit?
Your attribute based constructor abort is very limited and while throwing an exception inside an ADJUST thingie would likely abort the constructor ... after wasting time and resources in the constructors and AJDUST lasers of the parent class(es) ... there doesn't seem to be a way to return undef.
Your OO system's new doesn't look like bless on steroids. It sounds more like bless overdosed with antidepressants.
Deciding when to call parent constructor?
If it's something an ADJUST block can fix SHOW US HOW!
Jenda
1984 was supposed to be a warning,
not a manual!
In reply to Re^2: Thoughts on new 'class' OO in upcoming perl
by Jenda
in thread Thoughts on new 'class' OO in upcoming perl
by cavac
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |