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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
June 20, 2021 02:41
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
64556b7f-771f-4778-9c35-0db0bcb19426@beta.fastmail.com
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?

-- 
rjbs
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