From: Stefan Rusterholz Date: 2007-07-20T23:18:04+09:00 Subject: Re: RCR? Added syntax for chains that possibly return nil Robert Dober wrote: > On 7/20/07, Trans wrote: >> > >> > But -> does not support default, that is a feature of your solution. > I have completely overlooked this :(, the -> notation implies nil as > default. > > And you are thus right about the example above, your idea is indeed > powerful :) > > Robert Well, default can still be established with ->, just the plain old way: foo = bar->baz || default # if anywhere in the chain is nil, you get the default Regards Stefan -- Posted via http://www.ruby-forum.com/.