develooper Front page | perl.perl5.porters | Postings from February 2019

Re: New defined-match operator

Thread Previous | Thread Next
From:
Richard Leach
Date:
February 22, 2019 01:37
Subject:
Re: New defined-match operator
Message ID:
CADWSe2ewVgOBnCYo5LeJacXp2zcncPCXOQavPRXDm2Q87CUcGw@mail.gmail.com
On Thu, Feb 21, 2019 at 6:50 PM Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
> * David Cantrell <david@cantrell.org.uk> [2019-02-21 13:25]:
> > We all know how convenient it is to write this:
> > Well, wouldn't it be nice to be able to write this:
> >
> >   if($foo //~ /bar/)

if($foo &&~ /bar/) seems cognitively easier.


Horrible line noise follows:

>     if ( ensure_defined($foo) =~ /bar/ )

&&(foo) =~ /bar/
or
$foo->&& =~ /bar/

>     ensure_defined($foo)->bar

&&($foo)->bar
or
$foo->&&->bar

>     ensure_defined(ensure_defined(ensure_defined($foo)->bar)->baz)->quux

&&($foo->bar->baz)->quuz
or
$foo->&&->bar->&&->baz->&&->quux
(if you assumed the && applied to all previous calls, then
$foo->bar->baz->&&->quux)

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