develooper Front page | perl.perl5.porters | Postings from October 2016

Re: Extend the fat comma to deal with undef

Thread Previous | Thread Next
From:
David Cantrell
Date:
October 6, 2016 11:12
Subject:
Re: Extend the fat comma to deal with undef
Message ID:
20161006111143.GA31629@bytemark.barnyard.co.uk
On Thu, Oct 06, 2016 at 05:59:28AM +0100, Sam Kington wrote:

>     mandatory(
>         this =>! this_does_something(),
>     );
> ... 
> =>! says ???we want this key-value pair???, so if the rhs returns the
> empty list you put in a scalar undef to maintain key/value parity

That clashes with ...

  some_key=>!some_boolean_function() 

where =>! is a fat comma with the rhs being the logical NOT of the
results of the function.

Of course, the Lord turns his face from those who don't use whitespace,
but they do exist. For example:
  https://metacpan.org/source/MOOCOW/Tie-File-Indexed-0.09/Indexed.pm#L217

> Does this make any sense?

Yes, provided some suitable syntax can be found.

-- 
David Cantrell | top google result for "internet beard fetish club"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About