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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
From:
David Nicol
Date:
June 17, 2021 19:36
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
CAFwScO_-yY0=H=b_7dz14yZSS797UbO7UPmsXCCCCFh4B9dtKg@mail.gmail.com
really? you've said "defer <CODEREF>" repeatedly, and it sounded like the
message I was responding to brought up the question of if defered block
would happen always, or only when the defer keyword was encountered during
run-time flow.

You did not dispute my claim that local::on_scope_exit (or whatever I
called that CPAN module) does essentially the same thing.

"defer" is a mechanism for running something after the exiting of a code
block, a/k/a scope, but before the invoking code gets the returned value
back, is it not?

On Thu, Jun 17, 2021 at 2:25 PM Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
wrote:

> On Thu, 17 Jun 2021 14:18:02 -0500
> David Nicol <davidnicol@gmail.com> wrote:
>
> > and at compile time, a SCOPE_EXIT phaser would attach its coderef to
> > the exiting of the scope, encountered during run-time flow or not. Or
> > alternately, activated by having encountered it during run-time flow.
> > SCOPE_EXIT blocks if any (are active) would run before unlocalization
> > of package vars.
>
> "code ref"
>
> "encountered or not"
>
> You seem to be describing a different thing that is not `defer {}`.
>
> --
> Paul "LeoNerd" Evans
>
> leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
> http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/
>


-- 
"Lay off that whiskey, and let that cocaine be!" -- Johnny Cash

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