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: Ignoring parameters
by Patrick R. Michaud other posts by this author
Jun 16 2005 2:33PM messages near this date
Re: Ignoring parameters | Re: Ignoring parameters
On Fri, Jun 17, 2005 at 07:05:11AM +1000, Damian Conway wrote:
>  Gaal Yahas wrote:
>  >On Thu, Jun 16, 2005 at 01:26:31PM -0600, Luke Palmer wrote:
>  >>>Say I have a class method in FooClass, callable as FooClass.greet():
>  >>>    method greet(Class $class: ) {
>  >>>       say "Hello, FooClass!";
>  >>>    }
>  >>
>  >>Aside from the fact that I don't think this is the right way to
>  >>specify class methods...
>  > 
>  >What do you think is the right way to specify them?
>  
>  I certainly can't speak for Luke, but I think the right way to specify 
>  class methods is:
>  
>  	method greet(FooClass ::class:) {
>  	    say "Hello, FooClass!";
>  	}

In the interest of keeping the design documents up-to-date, A12 says:

    To declare an ordinary class method, such as a constructor, you say
    something like:

        method new (Class $class: *@args) { ... }

    Such a method may only be called with an invocant that "isa" C<Class> ,
    that is, an object of type C<Class> , or derived from type C<Class>.


S12 says:

    Class methods are just methods that can take a class as their invocant.

Somehow I read these as though the original poster was correct --
i.e., one creates a class method for FooClass as either

    method greet(Class $class:) { say "Hello!"; }

or

    method greet(FooClass $class:) { say "Hello!"; }

Are the design documents out of date in this regard?  If so, can
someone provide a patch, if not, can someone confirm that the design
documents are correct?  (I just happened to be looking at class methods
this past week, which is why I was a little surprised by Luke and 
Damian's answers... :-)  

Pm
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