On Thu, Mar 13, 2003 at 01:47:19PM -0500, Chris Dutton wrote:
This may have been asked before, and I apologize if I somehow missed it, but can junctions be used for multiple properties?
I can see it possibly being useful in a situation like the following(which may be completely off, as I'm still digging my way through A6):
class Foo { method bar is public is rw {
} }
Becoming:
class Foo { method bar is public & rw {
} }
Guess it just reads a bit better to me.
I don't think that junctions make sense here. Besides, the "is" is optional:
class Foo { method bar is public rw const frob knob { ... }
}
What we do need is some way of bundling a bunch of traits together under a simple name. This is especially useful for long involved types. Some of the type name examples in A6 are very long and if you needed to use the type several places, are not only a pain to type but you run into the "is it real the same every where problem" and the "did I change it every where" problem. As a general principle any time you have a long complicated token string that need to be use multiple places, you need a way to assign it a short hand name.
Yes, a string macro will do it, but has a couple of problems: 1) difficult to generate associated error messages 2) macros are very heavy weight for this
Defining a Class for this is also overkill.
Maybe something like
rule traitdef :w { trait <ident> <trait>* ; }
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) {...}
-- Mark Biggar [EMAIL PROTECTED] [EMAIL PROTECTED]