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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
June 23, 2021 04:14
Re: RFC 0004 - defer {} syntax
Message ID:
On Tue, 22 Jun 2021 at 20:16, David Nicol <> wrote:

> how about some kind of way to inject coderefs into the call stack, perhaps
> by using C<caller(n)> as an l-value?
>    sub wibble{ caller(0) = sub  { say "This runs after Hello" } }
This syntax is limited to callers only.

From discussion here - it's clear to me that many of you think in the terms
of context oriented programming (without realizing it ...)

Looks like there are two kind of defer usage:
- code layout oriented
- data scope oriented

Although defer may be legit observing code layout.majority of usage may be
related to data frame cleanup (aka: defer (whenever $dbh is defined) { })

Speaking about loop exit operators: how it behaves in with dump ?

This still covers only "programmer-perfect" code, as implemented - doesn't
cover tests, reuse, where whole change one may need
is attach defer to addressable context from outside (see "define meta

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About