Matt Greenwood wrote:
> why have both concat and
> add...?

How, exactly, is taking two strings, making a third string that's big enough to contain both, and copying the contents of those two strings into the third one like taking two numbers, doing a binary OR with carry, and storing the result in a third number?

Some languages overload addition to do both. Other languages don't; in fact, a Perl add and a Perl concat (to take one example) behave very differently from one another.

Generally speaking, it's better for compilers to do a bit of extra work to figure out the argument types involved than it is for them to throw away information they already have. (Besides, it's not that big a deal with PMCs--a PythonString can put the same code in its concat_*() and add_*() vtable entries.)

--
Brent "Dax" Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker

Oceania has always been at war with Eastasia.

Reply via email to