Re: ./method
by Darren Duncan other posts by this author
Jun 18 2005 9:02PM messages near this date
Re: ./method
|
Re: ./method
At 1:54 AM +0200 6/19/05, Juerd wrote:
> Except for attributes, which play a different game: the colon comes
> *instead* of the dot as the twigil, while the accessor method gets : in
> front of its name. If I recall correctly, the syntax is very misleading
> in that it is NOT part of the name.
I would argue that the same rule applies to attributes and methods
alike; privates of both have ':' as part of their name, and *every*
attribute or method reference, public or private, has a '.'. No
"instead" here.
So if you just factor out the ':' as being part of a private thing's
name, then all other discussions for syntax can treat public and
private the same way.
This goes for both explicit invocant forms like $obj.attr or
$obj.meth and implicit forms like $.attr or $.meth, where in all
cases 'attr' or 'meth' may or may not contain a leading ':', but it
doesn't matter for the main discussion, except that ':' can't be used
in the trailing edge of the operator.
Its much more consistent that way.
> $.bar $.:bar # I wouldn't mind if $:bar were an *abbreviation*
I agree and would accept $:bar *if* it were officially an
abbreviation, as you suggest, just like one can omit the '.' on
things like $foo.[0].{'bar'}; however, the full/longer form should
always be valid syntax.
-- Darren Duncan
Thread:
Gaal Yahas
Luke Palmer
John Siracusa
Damian Conway
John Siracusa
David Storrs
Matthew Zimmerman
Juerd
Matthew Zimmerman
Damian Conway
David Storrs
Juerd
Kurt
Jonathan Scott Duff
Juerd
Juerd
Kurt
Juerd
John Siracusa
John Siracusa
Adam Kennedy
Juerd
John Siracusa
Adam Kennedy
John Siracusa
Darren Duncan
John Siracusa
Juerd
Juerd
Darren Duncan
John Siracusa
John Siracusa
John Siracusa
Damian Conway
Abhijit Mahabal
Damian Conway
Patrick R. Michaud
John Siracusa
Larry Wall
Gaal Yahas
Damian Conway
Patrick R. Michaud
Damian Conway
Patrick R. Michaud
Larry Wall
Patrick R. Michaud
"TSa (Thomas Sandlaß)"
Larry Wall
|