On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote:
> On Wednesday 18 January 2006 17:57, Rob Kinyon wrote:
>
> > Well, for one thing, you can't write OO code in P5.
>
> I'll play your semantic game if you play my what-if game.
>
> I have a fair bit of Perl 5 code.  Ponie works.  I want to migrate my Perl 5
> code to Perl 6 slowly.  Everything new is Perl 6 code.  When I have a chance,
> I migrate classes and modules from Perl 5 to Perl 6 code.
>
> I have a handful of Perl 5 classes.  One day, I need to subclass one of them.
> Per my goal, I do so in Perl 6.  Of course, it has to interoperate with the
> Perl 5 in the system, per that pesky Liskov rule.  If I can specify an
> alternate internal representation for the object corresponding to the
> appropriate internal representation for the Perl 5 class I'm extending,
> great!

I think the more relevant question is "How do I subclass a Ruby class
in Python and delegate to it from a Perl6 object that's used in a
Perl5 module that's implementing the event loop for a Java app?"

The answer, of course, is that everything is mediated by Parrot (or
whatever VM they all choose to target). Just because one side is Perl6
and the other side is Perl5 doesn't mean that they should have any
closer of a relationship than Ruby and Python would. They are separate
languages, related only through a common creator, a shared community,
and the same VM. Nothing less, nothing more.

As for how that will be handled, I would think that it would be as follows:
    - in Perl6, objects created in another language will be treated as
p6opaque (unless some other unbox is a more suitable $repr).
    - in Perl5, objects created in another language will be treated as
inside-out objects.

> If not, your programming language sucks and doesn't do what the box leads me
> to believe that it should do -- especially if the answer is "Well you
> shouldn't want to do that."

The box you're talking about is the box with "Parrot" on the cover,
not Perl6. And, you most definitely want to be able to do what you're
suggesting and it will be possible.

You'll just have to give up on the mismeme of &bless, and I think
you'll find that oddly freeing.

Rob

Reply via email to