At 10:44 AM -0700 5/6/04, chromatic wrote:
On Thu, 2004-05-06 at 10:39, Aaron Sherman wrote:

 The simple case is:

        sub foo(X $i is rw) {...}
        class X {...}
        class Y {...}
        my Y $var = 'something';
        foo($var);

 In this case, something kind of interesting has to happen.

 Either the signature checking has to verify that Y isa X (and thus can
 be used polymorphically as X, not just converted to X) ...

I'd argue 'Y does X', actually, though Dan disagrees and says "Well, whatever!"

Nope. Dan says "Is that X in the signature an assertion of interface or of parentage?" and has the Perl 6 compiler emit the appropriate code. (Parentage is the safer option generally, since only in perl 6 is the class == interface assertion going to be true, and you might want to be able to yank in Python/Ruby/Perl5/Objective-C/Java/C#/C++ objects and classes. Or... you might not, which is fine too)
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to