in reply to Re: Re: AbstractClassFactory
in thread AbstractClassFactory
You put the code $class = ref($class) || $class into your module. There's no good reason for you to do that. People here go on endlessly about this specific meme but in your particular case it is particularly extraneous. The only possible reason you would have for it in this example is for cargo cult reasons. See cargo cult programming. It should merely be left as my $class = shift without the "maybe clone this object but not really" meaning you're getting. Part of my original objection was that you didn't even need the blessing for what you were doing and this part I'm quibbling over muddies the waters even more.
The other thing you're missing is that there is a universe of uses for closures and that isn't about "trying to find a use". If you really want to give your mind a spin go read up on Capabilities and faceted objects over at E in a Walnut. You'll come out better for it (it's only 70 pages and if you feel like it most of the middle can be skipped).
Fun Fun Fun in the Fluffy Chair
|
|---|