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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
June 17, 2021 17:35
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
CAHAeAG6ULiccVadg1NCQa1oY8m1ZO5YyqYxm6fhUj1HLG5jQeA@mail.gmail.com
On Thu, Jun 17, 2021 at 7:07 PM David Nicol <davidnicol@gmail.com> wrote:

> it's a phaser, phasers are all-caps, whatever it's called. BLOCK_EXIT
> maybe. My other often wished-for phaser is ONCE.
>

  Is it?  I would have expected a phaser to take (some) effect at compile
time.  As would the RFC, it seems: " All the SHOUTY PHASER BLOCKS are
declarations, activated by their mere presence at compiletime, whereas
`defer {}` is a statement which only takes effect if dynamic execution
actually encounters it."

  But I'm not sure what we should expect.  What even is a phaser in Perl
5?  Is this the occasion to land a definition?

  (In Raku a phaser is documented to be a trait of a closure.  It's not
clear to me if they could be applied after compilation, but they certainly
don't do so out of the box.)


Eirik

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