in reply to Re: What should this do?
in thread What should this do?

This is one of the reasons that I wish => imposed scalar context upon both its left and right sides. Unfortunately, rampant overuse of => as a "cute" comma in a wide variety of situations that are inconsistant with its genesis of denoting a hash's "key => value" relationship have made such an improvement pretty much impossible in Perl 5.

I can't recall enough about Perl 6 at the moment to guess at whether this has been considered for Perl 6, would "fit in" for Perl 6, or would just no longer be an issue there. (:

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: What should this do?
by TheDamian (Vicar) on Dec 06, 2001 at 08:40 UTC
    In Perl 6, => is a constructor for the built-in PAIR datatype (see: Apocalypse 3 and Exegesis 3).

    Both arguments of the pair constructor are evaluated in scalar contexts. In the problem code above, that would cause the param method to be called in scalar context, which would cause its "empty return" to return undef instead of that pesky empty list.

    So I guess the short answer is that it...

    would just no longer be an issue there.
      There is only one real reply to this... sweet!