> I may be raining on your RFC 337 parade here (sorry I didn't get to it
> earlier - travel), but I think it entirely reasonable to want to specify a
> type for an array different from the type of thing it contains.  But what
> syntax will you use?  If I make one up for the sake of illustration:
> 
>      my DogPound(Dog) @kennel :homeless;
> 
> then @kennel->municipality, but $kennel[37]->breed.  Make sense, or should
> I just go back to bed?

In short: I don't see that as a problem. RFC 337 and 279 together
explicitly say that this syntax should now be viable:

   my Pet @pets;
   $pets[0] :fluffy = "kurt";        # assign explicit attribute
   my Dog $pets[1] :mean = "spot";   # re-type a specific element

It's unchartered territory. But I don't see why it wouldn't work. The
only troublesome one is that last one, since it requires re-lexicalizing
the scope, which has no meaning for individiual array/hash elements
currently. So perhaps an alternate syntax:

   $pets[1] :type('Dog') = "rufus";  # re-typing

(with :type being a special builtin attribute) would be needed. Most of
this is in RFC 279 (except that :type thing, I just thought of that :-).

-Nate

Reply via email to