On Fri, 30 Apr 2010, Michel D. wrote:
would become (much) more elegant?
used to syntactic sugar, you’ll ask for some more … Remember Dijsktra
: “abuse of syntactic sugar gives cancer of the semi-colon”.
I don’t think there’s any syntactic sugar here. I always think of
syntactic sugar as “It looks like it’s doing X, but it’s really [or
also] doing Y.” For example, x * y, where it looks like an infix
operator but is really sending a message to an object.
In the case of the while in modifier position, it looks like it’s
equivalent to this:
ind += 1
and it is. I prefer this to having it be equivalent to:
loop do x += 1; break x if <some_test>; end
David A. Black, Senior Developer, Cyrus Innovation Inc.
THE Ruby training with Black/Brown/McAnally
COMPLEAT Coming to Chicago area, June 18-19, 2010!