From: "Peña, Botp" Date: 2004-10-02T11:16:36+09:00 Subject: Re: consider "..." as ellipsis (Re: Range syntax theory) Bob Sidebotham [mailto:bob@windsong.bc.ca] wrote: > Zach Dennis wrote: > > 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. > If you think of "..." as ellipsis (an English language punctuation > mark), then these definitions seem to match the Ruby interpretation: > > http://www.yaelf.com/punctuation.shtml > Ellipsis: From the Greek for "to come short", originally used > in geometry. > > http://www.u-aizu.ac.jp/~tripp/punc.html > Ellipsis (...) is used to show that something has been omitted. > > http://en.wikipedia.org/wiki/Ellipsis > an ellipsis (plural: ellipses) is a row of three dots (...) or > asterisks > (* * *) indicating an intentional omission. consider: from "I, Peter, Paul, James, and Mary joined the rubyconf last year." to "I, Peter,... Mary joined the rubyconf last year." 1. "Paul, James" were omitted in the notation but they joined indeed 2. and Mary is _not_ excluded! I think the ".." notation came fr "...". But the ".." was easier to type (you know *nix/pl guys better), so the history. But now we used "...", so the confusion addressed by the op. One could think the other way too (reminds me of someone mentioning lateral thinking). Maybe the english notation is _not_ so good after all. Maybe ellipsis should be two dots ".." (hey, we have computers now, right?). This would put the ruby notation of "..." as a logical representation of end exclusion... In the end, it is not adviseable to think in english when using a programming language. If you program in ruby, just think in ruby. > > Bob Sidebotham > kind regards -botp