From: Robert Klemme Date: 2006-03-23T00:13:51+09:00 Subject: Re: questions/suggestions from a Ruby newbie Diego.Virasoro@gmail.com wrote: > -Fortran 95 had a really nice feature when using arrays: you could > assign values using ranges. I am glad to see something similar exist in > Ruby too, (eg. variable[0..100]=0) > However F95 went a bit further, since the ranges could include an > optional parameter, the step. In F95 it would look something like: > variable[min:max:step] = 0 > There's a lot of cases when something like this is really convinient. I > know you can produce a similar effect using a few more lines, but I > think a feature like a range+step would have several advantages, namely > that it would look more clear in less code (a common feature in Ruby) > and it's closer to the way we think to be very desirable. Has there > been any talk about such a feature in future Ruby? Not that I heard of. It doesn't sound like it was too difficult to implement though. > -What is the difference between the << and + concatenation for strings? > Is it just that the former modifies the string while the second one > returns a new string? Right. > Why then not use something like +! (just as an > alternative)? That's ugly IMHO and also just syntax. "<<" is well known in other languages (namely C++) for stream appending which is basically what it is. Also operator "+!" might introduce problems in the syntax. Kind regards robert