From: "Brian Schröder" Date: 2004-09-30T23:32:28+09:00 Subject: Re: Range syntax theory gabriele renzi wrote: > Zach Dennis ha scritto: > >> How range operators work seems sort of backwards to me. It would >> appear as if the "..." (three dots) would be the inclusive one, >> including the last value and the ".." (two dots) would be exclusive >> and exclude the last value. > > > actually, I thought till one moment ago that ... was going to be > deprecated. I looked up and found that I misremembered this: > http://www.rubyist.net/~matz/slides/rc2003/mgp00025.html > > I'd strongly advocate the elimination of z...y . > It is completely non obvious, and it has no advantage _i can see_ over > x..k . > > > Maybe you can submit an rcr about it, you'll get many positive votes, I > guess. > > PS > I also think that if x...k disappear we could have an x.. literal, > (equivalent to x..-1 to express unlimited Ranges) without ambiguity. > > I would love to have : > 'ciao'[1..]=='iao' #=>true > instead of > 'ciao'[1..-1]=='iao' #=>true > That is nice, but why does it conflict with having the ... operator? I've used ... when I translated some algorithms from pseudocode in constructs like for i = 0...n I like that I don't have to write n-1. On the other hand that seems a bit cryptic (and we don't want to end up with perl like line noise ;) And most for constructions can be better expressed by iterators/generators. Anyhow. Why does your proposal conflict with the ... operator? Regards, Brian -- Brian Schr�der http://ruby.brian-schroeder.de/