|Pathologically Eclectic Rubbish Lister|
Re^6: Language features affect styleby TimToady (Parson)
|on Jun 10, 2009 at 19:20 UTC||Need Help??|
We're kinda confusing levels here. There are really three viewpoints of an object:
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.