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: supertyping
by TSa other posts by this author
Dec 14 2006 4:06AM messages near this date
Re: supertyping | Re: supertyping
HaloO,

Larry Wall wrote:
>      role Num is also does Complex {
>  	method im {...}
>      }

Is that the actual syntax? I mean is it the keyword pair
'is also' or does 'also' by itself have a meaning? With
a more natural 'role Num also does Complex'.


>  but roles are really supposed to be fairly immutable in the Perl 6
>  scheme of things, so such a declaration would probably have to require
>  that the Num role never have been composed into anything else yet.

Doesn't a role also do the package role? That is we might just
keep the uncomposed roles and their does-hierarchy around for
later method lookup.


>  Or we could say that you can't reopen the Num role; you can only
>  reopen the Num class and mix in the Complex role.  That's where it
>  stands at the moment.

BTW, how is it achieved to have a class Num and a role Num?
Can one just write

     role Blahh {...}

     class Blahh does Blahh {...}

or is there some hidden magic for built-in types? Array, Hash etc.
seem to pull the same stunt---but how?


Regards, TSa.
-- 
Thread:
Jonathan Lang
Jonathan Lang
Smylers
Larry Wall
TSa
TSa
Smylers
Ruud H.G. van Tol
Ruud H.G. van Tol
TSa

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved