Nikolai Weibull <email@example.com> writes:
I disagree, and I don't see why everyone hates
I think it is more consistent to write
while foo; bar; baz; quux; end
Yes, but you can write it as
while foo: bar; baz; quux end
Which, in my opinion, clearly separates the foo from the
bar and the baz.
Since we're already discussing mitutiae, I'll chime in and
say that I too prefer the colon here, simply because it
makes for more readable code. I'd write it as follows:
while foo: bar ; baz ; quux end
I always put spaces around semicolons in Ruby code ---
perhaps to reflect their rather symmetrical nature...
Actually, I'd probably use `do' rather than the colon.
I'd like to see `do' and `:' allowed after `def'.
def delta: last - first end
def request_foo do send "NEED FOO" end
In re while modifiers, I have defined a high-precedence
statement separator operator called `and then', which I
occasionally use when writing two-statement while loops:
lather and then rinse while dirty?
Apart from the higher precedence, the semantics of `foo and
then bar' is the same as `foo ; bar'. The preprocessor
translates `foo and then bar' into `foo or true and bar'.
No punchline, just some random thoughts.
Daniel Brockman <firstname.lastname@example.org>