[Python-Dev] Parrot -- should life imitate satire?

Thomas Wouters thomas@xs4all.net
Wed, 1 Aug 2001 10:58:13 +0200


On Wed, Aug 01, 2001 at 11:37:47AM +0300, Moshe Zadka wrote:
> [Moshe Zadka]
> > PUSH "1"
> > PUSH "2"
> > BINARY_ADD
> >
> > In Python that gives "12". In Perl that gives 3.
> > Unless you suggest a PERL_BINARY_ADD and a PYTHON_BINARY_ADD, I
> > don't see how you can around these things.
> 
> [Tim]
> > Perl needs distinct flavors of BINARY_ADD for its infix "+" and "."
> > operators.  Once you accept that, there's no real problem here (it simply
> > means that Python's and Perl's "+" operators would need to map to different
> > opcodes).

> And if you call Python's + opcode PYTHON_BINARY_ADD and Perl's
> PERL_BINARY_ADD, it's exactly what I said, isn't it?
> Are you agreeing or disagreeing with me? ;-)

He's disagreeing. It's not a PERL vs. PYTHON ADD at all; it's a "string
concatenation add" vs. "numerical add". Perl code using the string
concatenation operator (apparently, it's not going to be ".", which scares
me shitless: Perl6 gets a new string concat operator, but it isn't going to
be "+" ? If it is going to be '+', how does it flexitype ?) would use the
string-concat add opcode, and Perl code and Python code doing '+' would get
the normal BINARY_ADD. The string-to-int conversion in Perl's '+' would be
put into the 'Scalar' type.

Channeling-Tim--probably-wrong-<wink>-ly y'rs,
-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!