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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
Eirik Berg Hanssen
June 17, 2021 17:35
Re: RFC 0004 - defer {} syntax
Message ID:
On Thu, Jun 17, 2021 at 7:07 PM David Nicol <> 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.)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About