Ovid publiustemp-perl6language2-at-yahoo.com |Perl 6| wrote:
So, isn't "isa" and the "£" merely things which can be added by
programmers by changing the grammar?  That was one of the design goals
of the language.

The capability needs to exist as part of the overall type system, with primitive hooks provided in the metaobjects. The understanding of subtype and F-bounds both need to be built into the "is this type OK?" binding logic and the very implementation of binding. The syntax to access these features -- to mark which type uses which matching rules -- is far more arbitrary and cosmetic.

The "isa" as a synonym for "is" would be a no-brainer macro. But marking the metaobject with the intention and updating all the calls to the metaobject that build the class based on the items in the class's main block, to do the subtype covariance/contravariance checking, is more than just updating the grammar. I also have one other trick planned -- perhaps using "isa" can suppress virtual type redefinitions, if used with suitable modifiers. That way you can turn off the "feature" that is making your parameters covariant without you explicitly overriding them.


Reply via email to