From: Matthew Kerwin Date: 2013-04-03T05:56:53+09:00 Subject: [ruby-core:53902] Re: [ruby-trunk - Feature #8191] Short-hand syntax for duck-typing --f46d04426edadf37bf04d966f91e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Apr 3, 2013 12:03 AM, "rosenfeld (Rodrigo Rosenfeld Rosas)" < rr.rosas@gmail.com> wrote: > > I believe you didn't understand the proposal, Matthew. a??.b would mean (a.nil? ? nil : a.b). So user.profile??.website??.thumbnail is equivalent to: > > user.profile.nil? ? nil : (user.profile.website.nil? ? nil : user.profile.website.thumbnail) You are correct, I thought a.b?? meant (a.respond_to? :b ? a.b : nil) since I thought I saw earlier something like `foo.empty???=B4 In that case the missing question marks were earlier in the sequence: if user??.profile??.website??.thumbnail --f46d04426edadf37bf04d966f91e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Apr 3, 2013 12:03 AM, "rosenfeld (Rodrigo Rosenfeld Rosas)"= <rr.rosas@gmail.com> wrote= :
>
> I believe you didn't understand the proposal, Matthew. a??.b would= mean (a.nil? ? nil : a.b). So user.profile??.website??.thumbnail is equiva= lent to:
>
> user.profile.nil? ? nil : (user.profile.website.nil? ? nil : user.prof= ile.website.thumbnail)

You are correct, I thought a.b?? meant (a.respond_to? :b ? a.b : nil) si= nce I thought I saw earlier something like `foo.empty???=B4

In that case the missing question marks were earlier in the sequence:

=A0=A0=A0 if user??.profile??.website??.thumbnail

--f46d04426edadf37bf04d966f91e--