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 19:49
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
20210617204937.1842a641@shy.leonerd.org.uk
On Thu, 17 Jun 2021 14:35:27 -0500
David Nicol <davidnicol@gmail.com> wrote:

> really? you've said "defer <CODEREF>" repeatedly

I hope I haven't ever said that. I have mentioned `defer { BLOCK }`.

Blocks aren't coderefs.

E.g. consider the way that  if(COND) { BLOCK }  is not a coderef.

It's verymuch not a coderef - `caller()` can't see it, it doesn't get
its own `@_`, you can't `return` from it, etc...

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