[EMAIL PROTECTED] wrote:
The problem (in general) with this requirement is that it conflicts with inhericance. Perl6 allows you to extend any type (using 'but' operator, for example) and so, any time you promise that something will be of a certain type, the type's children will be allowed. That's at least the way I read A12. I also think that juntions will have their elements' type's interface and so they can also pose for any type. In other words, you need a real polymorphic object system in Haskell for this to work.However, I wonder how to talk about an array that can contain elements of any value type, but all the elements must have the same type. Is Perl6 capable of expressing such a restraint?
Thanks,
/Autrijus/
Fortunately there's one handily described at http://homepages.cwi.nl/~ralf/OOHaskell/
While we're on the topic, which of the following are true?
3 but "three" ~ int (false?) 3 but "three" ~ Integer (true?) 3 & 5 ~ int (true?) 3 & 5 ~ Integer (true?)
(Skipping off topic, to Parrot. Sorry. :) ) If 3 & 5 is actually int, and this is only determinable at runtime, to me this seems like a problem with I# register allocation - ints can't be reliably assigned to I# registers. Unless, of course, you autothread at the point when a junction has to be cast into an int. Do I understand junction semantics correctly?
Miro