From: Christopher Browne Date: 2002-09-11T01:34:29+09:00 Subject: Addition on appropriate fields... The world rejoiced as David.Stagner@mpls.frb.org wrote: > This is a multipart message in MIME format. > --=_alternative 0051BBBD86256C30_= > Content-Type: text/plain; charset="us-ascii" > > I think Gavin is right... we don't "add" strings, we concatenate them. > Using the + operator to mean "concatenate" violates our eighth grade > algebra sensibilities. It's, um, surprising. > > Note that the often-awkward Perl uses . as a string concatenation > operator, not +. This is one of the things Perl got right and Ruby got > wrong, imho. Anyone that has studied abstract algebra _won't_ be overly confused by this, as the first entry into group theory will leap you into addition systems that don't work the way you used to expect. Admittedly, that's a long way from eighth grade algebra. But on the other hand, if you're going to get _anywhere_ in being a computer programmer, you have _got_ to be cognizant of the fact that addition on computers doesn't work with the "abstract purity" it did in grade eight: a) 1.0 + 0.000000001 may not add up to exactly what you expected. b) 2147352576 + 175000 often will not add up to 2147527576 unless you are using Common Lisp, where that can revert to a BIGNUM. Computer addition generally isn't like grade eight. -- (concatenate 'string "chris" "@cbbrowne.com") http://www.ntlug.org/~cbbrowne/sap.html But what can you do with it? -- ubiquitous cry from Linux-user partner. -- Andy Pearce,