in reply to Private method variations
Just thinking aloud, but could something similar be done to enforce private variables? This would be a cool feature to have, even if strangely implemented. Hopefully in the same module?
Even if some extra private-variable functionality was not added, I can see how this could trivially be used to restrict an accessor/mutator function. Generally I try to write my OO such that trivial accessor/mutators aren't needed (too many accessors/mutators tends to indicate design flaws), but in Perl, the accessor/mutators are somewhat useful since it's way too easy to create a typo in a hash lookup.
Also, source filters, from what I know of them, are supposed to be evil...but as long as this one doesn't bork with line numbers, it should be ok! Seems like goodness to me.
Cool. I'd say definitely put something like this on CPAN. I'd use it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Private method variations
by adrianh (Chancellor) on Mar 01, 2004 at 08:39 UTC | |
Re: Re: Private method variations
by esskar (Deacon) on Mar 01, 2004 at 02:09 UTC | |
by flyingmoose (Priest) on Mar 01, 2004 at 05:28 UTC |