Re: RFC 159 (v1) True Polymorphic Objects

[email protected] (Bennett Todd) Wed, 6 Sep 2000 09:42:07 -0400
Newsgroups perl.perl6.language.objects
Message-ID <[email protected]>
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
signature.asc (application/pgp-signature, 232 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.2 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE5tkmvL6KAps40sTYRArHUAJ93Z8JO+EtEGiVPWx+0D334QjGIXACfftoW
cugytNFAh5fy1G4WT8yp0zs=
=JcJy
-----END PGP SIGNATURE-----