go ahead... be a heretic | |
PerlMonks |
Re^6: Factory Pattern in Perl6by hardburn (Abbot) |
on May 20, 2016 at 20:31 UTC ( [id://1163681]=note: print w/replies, xml ) | Need Help?? |
Thanks--returning self at the end does fix that branch of the code. As for why converting away from a role helped, doing that was also meant using BUILD rather than BUILDALL; apparently, you don't have to return the object at the end of BUILD. It doesn't seem clear from the documentation that returning from BUILDALL would matter. Of these spots: https://doc.perl6.org/language/objects#Object_Construction None of them talk about the return value of BUILDALL, nor is it shown in the example code. Frankly, the perl6 docs seem to spend a lot of effort on showing how clever the language can be, and not enough on explaining what's going on. "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
In Section
Seekers of Perl Wisdom
|
|