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

Paul Prescod paulp@ActiveState.com
Tue, 31 Jul 2001 13:48:45 -0700


Moshe Zadka wrote:
> 
>...
> 
> 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.

I'm not endorsing the approach but I think the answer is:

PUSH PyString("1")
PUSH PyString("2")
BINARY_ADD

versus

PUSH PlString("1")
PUSH PlString("2")
BINARY_ADD

i.e. the operators are generic but the operand types vary across
languages. So you can completely unify the bytecodes or the types, but
trying to unify both seems impossible without changing the semantics of
one language or the other quite a bit.

-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook