From: David.Stagner@... Date: 2002-09-10T23:54:31+09:00 Subject: Re: Larry Wall's comments on Ruby 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. dblack@candle.superlink.net 09/10/02 09:35 AM Please respond to ruby-talk To: ruby-talk@ruby-lang.org (ruby-talk ML) cc: Subject: Re: Larry Wall's comments on Ruby Hello -- On Tue, 10 Sep 2002, nico wrote: > On September 10, 2002 04:38 am, Gavin Sinclair wrote: > > > I'm not convinced that it's unnatural. We don't know the types of a and > > b, and for some objects a and b, a + b != b + a. > > > > I'm interested what you think the alternative is, or an argument against > > the above, and how you would like to see a + b defined in Ruby. > > > > Gavin > > I find that highly unnatural because we've been learning since grade school > that a + b = b + a. > > If the objects don't satisfy that property they should be using a different > symbol. On the other hand, in grade school you probably weren't adding strings. David -- David Alan Black | Register for RubyConf 2002! home: dblack@candle.superlink.net | November 1-3 work: blackdav@shu.edu | Seattle, WA, USA Web: http://pirate.shu.edu/~blackdav | http://www.rubyconf.com --=_alternative 0051BBBD86256C30_= Content-Type: text/html; 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.



dblack@candle.superlink.net

09/10/02 09:35 AM
Please respond to ruby-talk

       
        To:        ruby-talk@ruby-lang.org (ruby-talk ML)
        cc:        
        Subject:        Re: Larry Wall's comments on Ruby


Hello --

On Tue, 10 Sep 2002, nico wrote:

> On September 10, 2002 04:38 am, Gavin Sinclair wrote:
>
> > I'm not convinced that it's unnatural.  We don't know the types of a and
> > b, and for some objects a and b, a + b != b + a.
> >
> > I'm interested what you think the alternative is, or an argument against
> > the above, and how you would like to see a + b defined in Ruby.
> >
> > Gavin
>
> I find that highly unnatural because we've been learning since grade school
> that a + b = b + a.
>
> If the objects don't satisfy that property they should be using a different
> symbol.

On the other hand, in grade school you probably weren't adding
strings.


David

--
David Alan Black                      | Register for RubyConf 2002!
home: dblack@candle.superlink.net     | November 1-3
work: blackdav@shu.edu                | Seattle, WA, USA
Web:  http://pirate.shu.edu/~blackdav | http://www.rubyconf.com



--=_alternative 0051BBBD86256C30_=--