Dan Sugalski:
# At 11:10 AM 12/14/2001 +0000, Simon Cozens wrote:
# >On Fri, Dec 14, 2001 at 12:06:51AM -0800, Brent Dax wrote:
# > > Also, a question if/once it exists.  I assume it'll make a copy.
# >
# >Yep. Although I'm not quite sure off-hand how to write it.
#
# Well, that depends. It could either make a copy, in which
# case it should
# call the target's assignment vtable entry, or it should just copy the
# pointer over, in which case it shouldn't do anything besides
# copying the
# pointer from one register to another.
#
# I'm thinking it should just be a pointer copy, and real
# assignment should
# have its own op. I'm open to debate on that, though.

But the general case is a copying assignment, at least in Perl.  Perhaps
the pointer copy would be a different op ('alias'?).

# > > If that's the case, then in this bit of code:
# > >
# > >       new P0, PerlInt
# > >       new P1, PerlString
# > >       set P1, P0
# > >
# > > is P1 a PerlString or a PerlInt?  I think PerlString,
# because otherwise
# > > there'd be no way to cast between types.
# >
# >Precisely.
#
# Nope. P1 will either point to the same PMC that P0 does, or
# you'll have
# called the assignment entry of P1's vtable, in which case it could do
# whatever it thinks is appropriate. (For normal perl scalars
# it'll be to
# morph itself to a PerlInt)

What I'm basically asking is, in that case are we going to be calling
        $1->vtable->set_string($2->vtable->get_string())
or
        $1->vtable->set_integer($2->vtable->get_integer())
?

If what you say is true, that brings up an issue then--how do we know
the difference between 'lt' and '<'?  Don't tell me we need to assign it
to an S or N register first to disambiguate--that's just plain evil (not
to mention that it totally circumvents the vtable).  (I'm encountering
this problem in my (probably hopeless) attempt to write a B::Parrot
module.)

--Brent Dax
[EMAIL PROTECTED]
Configure pumpking for Perl 6

"Nothing important happened today."
    --George III of England's diary entry for 4-Jul-1776

Reply via email to