--- Michael Lazzaro <[EMAIL PROTECTED]> wrote:
> On Thursday, March 13, 2003, at 12:04  PM, Mark Biggar wrote:
> > What we do need is some way of bundling a bunch of traits together
> > under a simple name.
> 
> Yes, yes, yes.
> 
> > Defining a Class for this is also overkill.
> 
> Ye.. well, no.  Why?
> 

Unless you mean trait-classes, because I may want the same common set
of traits to apply to multiple distinct things (different classes,
objects, whatever).

So:

type cat_table is Hash of Array of Array of Hash is traits_only;

or 

type cat_table is Hash of Array of Array of Hash;

More to the point:

type sigfunc is interrupt is reentrant;

sub sig_ign() is sigfunc {...}
sub sig_kill() is sigfunc {...}
sub sig_intr() is sigfunc {...}

type null but defined but false;

...
return undef but null;

=Austin


> > So instead of saying:
> >
> >     my %pet is Hash of Array of Array of Hash of Array of Cat;
> >     sub feed (%cats is Hash of Array of Array of Hash
> >                     of Array of Cat) {...}
> > You could say
> >
> >     trait cat_table is Hash of Array of Array of Hash
> >             of Array of Cat;
> >     my cat_table %pet;
> >     sub feed (cat_table %cats) {...}
> 
> I think classes are not necessarily the heavyweights some people
> might 
> expect them to be...  I think of them more as types, actually.  
> Basically, if you replaced the word 'trait' with 'class', I think the
> 
> current plan is that you can do exactly what you're suggesting:
> 
>      class CatTable is Hash of Array of Array of Hash of Array of
> Cat;
> 
>      my %pet is CatTable;
>      sub feed (%cats is CatTable);
> 
> (note I fixed the last lines to use the right syntax... before, you 
> were actually saying that %pet was a Hash of CatTables...)
> 
> MikeL
> 

Reply via email to