From: Robert Dober Date: 2007-07-20T22:47:06+09:00 Subject: Re: RCR? Added syntax for chains that possibly return nil On 7/20/07, Trans wrote: > > > On Jul 20, 6:29 am, "Robert Dober" wrote: > > On 7/20/07, Trans wrote: > > > > Hmm I like the expressiveness of the original proposal > > look at this example > > > > bar->baz.foo, which has to be written as > > (bar.baz ||| default).foo > > > > of course one could write > > bar.baz.foo ||| default > > but it has more permissive semantics and will hide errors that > > bar->baz.foo > > will raise > > Robert > > But where is default in your example? You'd have: > > (bar->baz || default).foo > 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 > T. > > > -- I always knew that one day Smalltalk would replace Java. I just didn't know it would be called Ruby -- Kent Beck