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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
June 17, 2021 11:20
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
20210617122045.5ad221cc@shy.leonerd.org.uk
On Thu, 17 Jun 2021 08:57:20 +0900
Yuki Kimoto <kimoto.yuki@gmail.com> wrote:

> Personally, I think defer block syntax is difficult to implement.

Hm? I've 95% finished implementing it. It was easy.

> Especially the relation of
> 
> 1. GC
> 2. Destructor
> 
> The relation of GG and block of Current Perl is simple. an object is
> released at the end of the block if the object  reference count is 0.
> 
> defer syntax maybe add complex things of this relation.
> 
> This feature seems to be planned for the finally block of try catch
> syntax.

Indeed; I can reĆ¼se about 90% of the implementation of `defer` to add a
`try/catch/finally`.

> Are there other strong benefits?

Mostly those.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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