Re: "with" statement
by Giles Bowkett other posts by this author
Oct 23 2007 4:22PM messages near this date
Re: "with" statement
|
Re: "with" statement
On 10/23/07, Robert Klemme <shortcutter@[...].com> wrote:
> 2007/10/22, Giles Bowkett <gilesb@[...].com>:
> > > module Kernel
> > > def with(object,&block)
> > > object.instance_eval &block
> > > end
> > > end
> > >
> > > with([1,2,3]) { length } # => 3
> >
> > This is really neat and compact.
>
> How is this more compact than
>
> [1,2,3].length
>
> ?
Check the rest of the thread.
--
Giles Bowkett
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com/
Thread:
Perry Smith
Dan Yoder
Pete Elmore
Randy Kramer
Giles Bowkett
Robert Klemme
Giles Bowkett
Stefan Rusterholz
Yossef Mendelssohn
Perry Smith
David A. Black
Robert Dober
Stephane Wirtel
|