ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved