Benjamin Goldberg writes:
> Hmm... I just thought of something.  Since 'set' semantics can be easily
> simulated when we have only ops for 'assign' semantics, maybe imcc
> itself could do this for us.
> 
> That is, by default,
>    $P0 = $P1 + $P2
> will be translated by imcc into
>    add $P0, $P1, $P2
> but, if some command is given to imcc, then it will be translated into
>    new $P0, .PerlUndef
>    add $P0, $P1, $P2
> Or, instead of PerlUndef, the command to change to set semantics would
> indicate what to put into $P0 prior to using it as the target of an add
> (so we can initialize $P0 with any of PerlInt, PerlNum, BigInt,
> BigFloat, BigRat, ContinuedFraction, etc.)

Hmm, I wonder whether this is the right approach.  What about operator
overloading?  Let's say Python overloads + (can it do that?) and passes
that variable to Perl.  If Perl creates a .PerlUndef and assigns to it,
you lose the overloaded semantics.

I don't know... I think using vtable multimethods would be the best way
to go wrt these things.

Luke

> -- 
> $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
> );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED]
> ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}

Reply via email to