From: Joshua Ballanco Date: 2009-05-14T14:20:01+09:00 Subject: Re: [bikeshed] Syntactic sugar idea On May 14, 2009, at 12:27 AM, Joel VanderWerf wrote: > Daniel DeLorme wrote: >> It seems that often an object will be passed into a block only to >> invoke >> a method of that object: >> arr.map{ |obj| obj.some_method } >> So I had the (weird? stupid?) thought that it would be nice to have >> some >> syntactic sugar like this: >> arr.map{ .some_method } >> Does that make any sense? > > It would be nice for avoiding instance_eval in DSLs: > > @x = 400 > @y = 300 > > config "my window" do > .width @x > .height @y > end > > but I just don't see how to fit it into ruby... Isn't this essentially the "with" syntax from Javascript? I think that could fit into a future version of Ruby... - Josh