2000-08-28-18:47:06 Tom Christiansen:
> It strikes me as a bit reminiscent of (one reason) why Larry
> didn't make a+b work on strings, since then while with numbers,
> a+b and b+a would be the same, with strings they would not be, and
> we have these rather deeply held convictions about such matters.

perl's internals may have distinct strings and numbers, but from the
programmer's viewpoint that distinction is nowhere near so clear; by
using distinct operators for string ops and arithmetic ops, Perl
automatically converts as needed, and so prevents the programmer
from seeing distinct strings and numbers, they're all just scalars
and do the right thing.

The a+b != b+a with + as string contatenation may be a happy
additional justification, but I think the underlying principle is
much more basic, and I don't think we can lose it without a really
dramatic change being imposed on the programmer's view of the Perl
language.

-Bennett

PGP signature

Reply via email to