On Apr 8, 2013 3:10 PM, "wardrop (Tom Wardrop)" <tom / tomwardrop.com> wrote:
>
> This is a feature suggestion that was raised while discussing issue
#8191. The feature suggestion is to introduce some form of logical method
chaining to address this reasonably common pattern:
>
>     user && user.profile && user.profile.website &&
user.profile.website.thumbnail
>
> It would be reasonably trivial to shorten this to:
>
>     user && .profile && .website && .thumbnail
>
> The implementation I propose would be for Ruby to allow an inferred
receiver; the dot prefix would be the syntax for this. The inferred
receiver would resolve to the result of the last expression in the current
scope.

What would be the result of:

    "abc"
    foo = lambda { .upcase }
    "def"
    foo.call

Is it "ABC" ?