From: Adam Prescott Date: 2011-07-21T20:37:59+09:00 Subject: [ruby-core:38327] Re: [Ruby 1.9 - Feature #5065][Open] Allow "}" as an alternative to "end" --001517740cb2c8261804a892c76f Content-Type: text/plain; charset=UTF-8 On Thu, Jul 21, 2011 at 6:28 AM, Lazaridis Ilias wrote: > module MyModule > class MyClass > def my_method > 10.times { # "10.times do" would work, too > if rand < 0.5 > p :small > } > } > } > } > } > I can't say I like this proposal, or my own thoughts below, but I would expect this, instead: module MyModule { class MyClass { def my_method { 10.times { # "10.times do" would work, too if rand < 0.5 { p :small } } } } } This keeps things consistent with blocks, e.g. 10.times { ... }, and makes sure there are matching pairs. That said, seeing "class MyClass {" is too great a deviation from existing Ruby syntax for me to find it acceptable, personally; one of the enjoyable things about Ruby is the lack of line noise, and this would probably count as noise added. --001517740cb2c8261804a892c76f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, Jul 21, 2011 at 6:28 AM, Lazaridis Ilias= <ilias@lazarid= is.com> wrote:
module MyModule
=C2=A0class MyClass
=C2=A0 =C2=A0def my_method
=C2=A0 =C2=A0 =C2=A010.times { =C2=A0 # "10.times do" would work= , too
=C2=A0 =C2=A0 =C2=A0 =C2=A0if rand < 0.5
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0p :small
=C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0}
=C2=A0}
}

I can't say I like this proposal= , or my own thoughts below, but I would expect this, instead:
module MyModule {
=C2=A0class MyClass {
=C2=A0 =C2=A0def my_method {
=C2=A0 =C2=A0 =C2=A010.times { =C2= =A0 # "10.times do" would work, too
=C2=A0 =C2=A0 =C2= =A0 =C2=A0if rand < 0.5 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0p = :small
=C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2= =A0}
=C2=A0 =C2=A0}
=C2=A0}
}

This keeps things consistent with blo= cks, e.g. 10.times { ... }, and makes sure there are matching pairs.
<= div>
That said, seeing "class MyClass {"=C2=A0is to= o great a deviation from existing Ruby syntax for me to find it acceptable,= personally; one of the enjoyable things about Ruby is the lack of line noi= se, and this would probably count as noise added.
--001517740cb2c8261804a892c76f--