Re: Generic classes.

2005-08-16 Thread Autrijus Tang
On Mon, Aug 15, 2005 at 11:07:51AM -0700, Larry Wall wrote: > Sure, except that you're not really inheriting from a role here. > You're really inheriting from an anonymous class of the same name. :-) Hmm, "Anonymous class with the name 'Array of Any'" sounds like an oxymoron. Also consider:

Re: Generic classes.

2005-08-15 Thread Larry Wall
On Tue, Aug 16, 2005 at 01:49:02AM +0800, Autrijus Tang wrote: : Aye. But if a Role can be inherited _from_, then this should : work too, right? : : role Point { : has $.x; has $.y; : method move_right { $.x++ } : }; : role OurPoint is Point { : method move_right { .

Re: Generic classes.

2005-08-15 Thread Autrijus Tang
On Mon, Aug 15, 2005 at 10:43:45AM -0700, Larry Wall wrote: > : So the last line means a role can be used just like a class, and > : _inherit_ its behaviour as well? > : > : role Point { has $.x; has $.y; method move_right { $.x++ } }; > : role MyPoint is Point { > : method move_right

Re: Generic classes.

2005-08-15 Thread Larry Wall
On Tue, Aug 16, 2005 at 01:33:56AM +0800, Autrijus Tang wrote: : On Mon, Aug 15, 2005 at 08:19:38AM -0700, Larry Wall wrote: : > I think the distinction is still useful to document that there are : > still unbound types. What we need to emphasize is that a role can be : > used as a class, at which

Re: Generic classes.

2005-08-15 Thread Autrijus Tang
On Mon, Aug 15, 2005 at 08:19:38AM -0700, Larry Wall wrote: > I think the distinction is still useful to document that there are > still unbound types. What we need to emphasize is that a role can be > used as a class, at which point any unbound types are bound to Any, > or whatever we're calling

Re: Generic classes.

2005-08-15 Thread Larry Wall
rns=>Array[returns=>Recipe]] %book; : : And later: : : class LoudArray is Array { ... } : : Clearly, here Hash and Array are used as instantiable, generic classes, : instead of mere roles. Does this need to change, or can we lift the : ban on type-parameterized classes? I think the dist

Generic classes.

2005-08-14 Thread Autrijus Tang
udArray is Array { ... } Clearly, here Hash and Array are used as instantiable, generic classes, instead of mere roles. Does this need to change, or can we lift the ban on type-parameterized classes? Thanks, /Autrijus/ pgpr7zGjVCxbv.pgp Description: PGP signature