in reply to Re^5: Language features affect style
in thread Language features affect style
- The external public view.
- The internal private view.
- The hidden MOP view
From the #3 perspective, sure, the fundamental accessor for the slot could be identical to method !foo, but then you're kinda hosed if the user wants to actually define the !foo method as a wrapper around $!foo, which would be an infinite regress if you confuse the user's slot accessor with the MOP's slot accessor. So unlike the situation with $.foo, the $!foo notation is not just syntactic sugar for a private accessor, and a private method must be called as self!foo.
So why would the user ever want to define their own private accessor? Primarily to mediate how much you want to dynamically "untrust" any other classes you've trusted by declaration.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Language features affect style
by John M. Dlugosz (Monsignor) on Jun 15, 2009 at 14:21 UTC |