develooper Front page | perl.perl5.porters | Postings from November 2021

Re: New function suggestion: eval-or-die

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
November 19, 2021 13:42
Subject:
Re: New function suggestion: eval-or-die
Message ID:
20211119134145.69cf79ad@shy.leonerd.org.uk
On Mon, 13 Sep 2021 10:03:02 +0100
"Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk> wrote:

> I feel it would be nice to provide a function of this behaviour in the
> new "builtins" space at some point. Needs a better name though -
> suggestions welcome.

Latest thoughts from PSC chats are that this probably wants to be
called `compile`, and should act similarish to

  my $subref = compile $source;

  my $subref = eval "sub { $source }" // die $@;

Though for now we'll park the idea while we actually get some progress
on the builtins namespace. Perhaps someone will come back to this after
that.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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