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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
From:
Martijn Lievaart
Date:
June 18, 2021 08:55
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
49440160-261b-c2c7-5f19-4965ee6656c9@rtij.nl
Op 18-06-2021 om 03:16 schreef Yuki Kimoto:
> I read the content of the Github issue again.
>
> defer block is like END block that runs at the end of the scope, isn't it?
>
> I feel this syntax is natural for Perl users now.
>
> It seems that some pseudo-things are implemented on CPAN as well.
>

Yes and no. Yes, it's like that, because it runs on the end of a scope, 
like END does at the end of the run. No, it's not like that as END 
blocks always run when compiled, but defer is a statement that must be 
executed for it to have it's effect.


HTH,

M4



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