Larry Wall wrote:
Anyway, I think the type constructors need to avoid overloading the logic operators. Perl 6 is an operator-rich language because that contributes to long-term clarity despite the short-term confusion.
OK. My main dog in this race is the idea of defining new roles through the concepts of the intersection or difference between existing roles (even the union was thrown in there mainly for the sake of completion), with the consequent extension of the type system in the opposite direction from the usual one (toward the more general); the exact syntax used for this is less of an issue, as long as it is straightforward and simple. Given that the set analogy is exactly what I'm using, I'd be fine using the Set operators (presumably '\xAD\xFC' and '\xAD\xFB') and their ASCII workarounds ('(|)' and '(&)'?) instead of '|' and '&'. Presumably, '-' is still the "difference of Sets" operator. And yes, this "roles as sets" paradigm would presumably mean that you could examine roles using '⊂', '⊃', '∈', and so on. Given the semantic aspect of roles, I don't think that I'd go along with saying that 'A ⊃ B' is equivalent to 'A.does(B)' - although I _would_ agree that if 'A.does(B)' then 'A ⊃ B'. Rather, I'd think of 'A ⊃ B' as being the means that one would use for duck-typing, if one really wanted to (presuming that one can mess with how perl 6 does type-checking). Likewise, 'm ∈ R' will match if 'R.can(m)'; but the definition of 'element' might be broader than just methods. -- Jonathan "Dataweaver" Lang