From: Matthew Kerwin Date: 2013-04-07T00:37:56+09:00 Subject: [ruby-core:54061] Re: [ruby-trunk - Feature #8191] Short-hand syntax for duck-typing --047d7b343bb4a9110d04d9b2fcbb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Apr 6, 2013 9:12 PM, "rosenfeld (Rodrigo Rosenfeld Rosas)" < rr.rosas@gmail.com> wrote: > > Matthew, if you have tried to provide a real use case you'd understand what I meant. For user.profile.website.thumbnail, for instance, don't you agree that neither user, profile or website are expected to be possibly "false" values? You'd never call false.thumbnail, right? And a website should never be false, although it could be nil, right? That's what I'm talking about. There's no sense in checking for false values before calling a method on it because no one in any real application would be calling any meaningful method over the "false" object, right? My guiding principle is: if the syntax mimics &&, the behaviour should test truthiness. My proposed abortive mechanism was `&&.=B4 --047d7b343bb4a9110d04d9b2fcbb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Apr 6, 2013 9:12 PM, "rosenfeld (Rodrigo Rosenfeld Rosas)" = <rr.rosas@gmail.com> wrote:=
>
> Matthew, if you have tried to provide a real use case you'd unders= tand what I meant. For user.profile.website.thumbnail, for instance, don= 9;t you agree that neither user, profile or website are expected to be poss= ibly "false" values? You'd never call false.thumbnail, right?= And a website should never be false, although it could be nil, right? That= 's what I'm talking about. There's no sense in checking for fal= se values before calling a method on it because no one in any real applicat= ion would be calling any meaningful method over the "false" objec= t, right?

My guiding principle is: if the syntax mimics &&, the behaviour = should test truthiness. My proposed abortive mechanism was `&&.=B4<= /p> --047d7b343bb4a9110d04d9b2fcbb--