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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
Ricardo Signes
June 20, 2021 02:41
Re: RFC 0004 - defer {} syntax
Message ID:
On Wed, Jun 16, 2021, at 6:15 PM, Paul "LeoNerd" Evans wrote:
> # defer {} syntax

I'll be brief.  First off, thanks, Paul, for doing a good job at dealing with this thread's ups and downs.

This seems like a reasonable proposal about which I have no strong feelings (yet).  But I do have a question:

This is similar to, but not the same as, UNITCHECK.  I would surely use this more often than I have used UNITCHECK, and I am definitely not here to say that defer is a phaser or redundant.

But when unitcheck was introduced, I remember thinking clearly and repeatedly that I'd have used it far often if it had been possible to inject the unitcheck upward one scope.  Honestly, I'd have to do a fair bit more thinking about it to remember the use cases I had in mind.  But you suggest (I think *very* hopefully) that we could eventually get away from timely destruction if we had better defer blocks.  I think often we'd like defer blocks to be produced by reusable code, which does hint toward the idea of "defer this until my calling scope is complete."

Do you think this is an area in which we should consider nudging the capabilities of this proposal?

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