From: Jim Weirich Date: 2004-02-01T16:33:46+09:00 Subject: Re: Save the flip/flop op! Hal Fulton said: > Michael campbell wrote: >> Well, I like the syntax, because I've trained my brain to understand >> it. > > Well, it runs counter to the rest of Ruby. My complaints about the flip/flop op are: 1) It is context sensitive. Is the following snippet of code a flip/flop? ... expression1 .. expression2 You can't tell unless you know the context where the snippet appears. Although Perl is full of context dependencies, it is rare in Ruby (this is the only one that comes to mind). 2) Although it looks like a range of regular expressions, it is not. Understanding the behavior of Regexps and Ranges gives no clue to the behavior of the flip flop op. In addition, understanding the difference between a two-dot and three-dot range doesn't shed any light on the difference between a two-dot and three-dot flip flop op. 3) It has state (hidden!), but it is not an object. I can't assign it to a variable or pass it to a function, nor can I send it messages. There have been a number of library based suggestions. I think something along those lines will make a nice replacement, and I suspect will be even more flexible in the end. IMHO. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)