[holy ruby programmers batman!] Potential addition: nil safe chaining

Giles Bowkett gilesb at gmail.com
Fri Dec 21 21:21:32 EST 2007


I'm thinking the egregious Law of Demeter thing is probably valid -
Utility Belt is for heroes not villains. Actually, though, I don't
want to seem dumb, but what's the use case?

On 12/21/07, Tim Connor <timocratic at gmail.com> wrote:
> Hey, Giles.  Are you interested in this functionality?
> http://pastie.caboo.se/131472
>
> I'd convert the tests to specs of course, but this is what I have, and
> is the easiest way to illustrate the behavior.
>
> I've been accused of egregious Law of Demeter with this, but I think
> it is a nice bit of sugar for conditionals where you want to call a
> method on something if it exists and otherwise return the nil
> reference.  Like anything, if abused it'd be a bad thing.
>
> Tim
> _______________________________________________
> Utilitybelt-tinkering mailing list
> Utilitybelt-tinkering at rubyforge.org
> http://rubyforge.org/mailman/listinfo/utilitybelt-tinkering
>


-- 
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com


More information about the Utilitybelt-tinkering mailing list