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 20:22
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
20210617212155.09a88479@shy.leonerd.org.uk
On Thu, 17 Jun 2021 22:16:35 +0200 (CEST)
shmem <gm@qwurx.de> wrote:

> And since "defer" is a function, it takes a coderef.

The entire point here is that adding it as real syntax means defer
*isn't* a function. It's real native syntax, as real as

  if(COND) { BLOCK }

  while(COND) { BLOCK }

  use feature 'try';
  try { BLOCK } catch($VAR) { BLOCK }

As such, it can operate on a block that isn't implemented as a coderef.

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