On Fri, 11 Oct 2002, Michael Lazzaro wrote:
: On Friday, October 11, 2002, at 04:11 PM, Larry Wall wrote:
: > has Nose $.snout;
: > has Ear @.ears is cut("long");
: > has Leg @.legs;
: > has Tail $.tail is cut("short");
: >
: > method Wag () {...}
: > }
:
: What's the rationale again for the dot in $.snout? Does it imply that
: it should be
:
: method .Wag () {...}
:
: to match?
Yes, that's part of it, presuming you actually meant:
method .snout () {...}
It also doesn't look like either a lexical or a global when you use
it within the method. I always hated that about C++.
I suppose it could be argued that the . is redundant within a "has",
but I kinda like the consistency. It could also be argued that
the '$' should be dropped on scalar attributes, but that's another
consistency thing. You can certainly drop it within the methods,
since there's also the accessor methods.
Larry