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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
Nicholas Clark
June 21, 2021 07:45
Re: RFC 0004 - defer {} syntax
Message ID:
Still wading through all the messages that appeared over the weekend,
but this is the most subtly amusing thing I've read today (actually for
some days):

On Sun, Jun 20, 2021 at 01:22:16PM +0100, Paul "LeoNerd" Evans wrote:

> As to implementation, I have no idea how to create this. `defer {}`'s
> current implementation is just to use SAVEDESTRUCTOR_X() which pushes
> to the same savestack as things like variable scope clearing and
> `local` uses. That's strictly a stack, and you can't splice into it
> lower down. There have variously been times I have wanted such
> an ability, but equally other times (most notably while implementing
> async/await) when I have been thankful for its absence.

"With this hat on I want feature X"
"With that hat on I hate my other self"

Most of the Perl internals is like this. It's a love-hate relationship with
yourself, depending on whether you're authoring code for CPAN or
(re)implementing core functionality.

Nicholas Clark

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