On Sat, Nov 23, 2002 at 07:34:47PM +0000, Simon Cozens wrote:
: [EMAIL PROTECTED] (Smylers) writes:
: > >    ... they believed that the + should concatenate the two strings.
: > > 
: > > Makes perfect sense to me.
: > 
: > Makes sense in a language where variables are typed
: 
: It also makes sense in a language where values are typed. They just
: have to be slightly more strongly typed than just "scalar". But Perl 6
: is already going to support INT and STRING built-in types, right? So I
: see no problem with + doing string concat. I could mention some other
: languages (or at least, a language (of which I'm becoming considerably
: more fond as I get to know it (especially having just come back from
: Japan (excuse the jet lag)))) which takes this approach.

While no assumption is going unquestioned for Perl 6, I do still
believe that the decision not to overload + for concatenation is one
of the few things I did right in Perl 1.  When people look at $a + $b
in Perl they don't have to wonder what it means.  Addition is such a
fundamental operation that it should be kept as clean as possible, both
for readability and for optimizability.  (The two are not unrelated.)

There are several things I like about Ruby, but using + for string
concatenation is not one of them.  It's another one of those areas
where the Principle of Least Astonishment is misapplied.  Any language
that doesn't occasionally surprise the novice will pay for it by
continually surprising the expert.  Ruby's scoping rules also fail
on this point, in my estimation.

Larry

Reply via email to