From: Yehuda Katz Date: 2009-08-23T17:22:46+09:00 Subject: [ruby-core:25051] Re: Proposal: Simpler block format --000feaf06d46831ce10471cacdd5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Sat, Aug 22, 2009 at 5:11 PM, James Edward Gray II wrote: > On Aug 22, 2009, at 7:04 PM, Yehuda Katz wrote: > > call_method({ proc_1 }, { proc_2 }, { proc_3 }) >> > > Among other things, this syntax makes using multiple blocks in a method >> call easier on the eyes. >> > > In 1.9 that could be: > > call_method ->() { proc_1 }, > ->() { proc_2 }, > ->() { proc_3 } > > Not quite what you asked for, I know. But closish. > > The new syntax is growing on me. I think it looks pretty good with the new > Hash syntax, for example: > > call_method load: ->() { proc_1 }, > save: ->() { proc_2 }, > quit: ->() { proc_3 } I'm fine with the new syntax as well. The main difference is that while ->{ stuff } would create a lambda, { stuff } would create a proc. I think there's a certain elegance to that. > > > Just some thoughts. > > James Edward Gray II > > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --000feaf06d46831ce10471cacdd5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sat, Aug 22, 2009 at 5:11 PM, James E= dward Gray II <james@graysoftinc.com> wrote:
On Aug 22, 2009, at 7:04 PM, Yehuda Katz wrote:

=A0call_method({ proc_1 }, { proc_2 }, { proc_3 })

Among other things, this syntax makes using multiple blocks in a method cal= l easier on the eyes.

In 1.9 that could be:


=A0call_method ->() { proc_1 },
=A0 =A0 =A0 =A0 =A0 =A0 =A0->() { proc_2 },
=A0 =A0 =A0 =A0 =A0 =A0 =A0->() { proc_3 }

Not quite what you asked for, I know. =A0But closish.

The new syntax is growing on me. =A0I think it looks pretty good with the n= ew Hash syntax, for example:

=A0call_method load: ->() { proc_1 },
=A0 =A0 =A0 =A0 =A0 =A0 =A0save: ->() { proc_2 },
=A0 =A0 =A0 =A0 =A0 =A0 =A0quit: ->() { proc_3 }

<= /div>
I'm fine with the new syntax as well. The main difference is = that while ->{ stuff } would create a lambda, { stuff } would create a p= roc. I think there's a certain elegance to that.
=A0


Just some thoughts.

James Edward Gray II




--
Yehuda Katz
D= eveloper | Engine Yard
(ph) 718.877.1325
--000feaf06d46831ce10471cacdd5--