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

Re: Pre-RFC: yield true feature

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
June 24, 2022 14:03
Subject:
Re: Pre-RFC: yield true feature
Message ID:
83acb33d-fccf-423f-9813-2588787cdb03@beta.fastmail.com
On Sun, Jun 19, 2022, at 08:23, Dave Mitchell wrote:
> On Fri, Jun 17, 2022 at 08:00:10PM -0400, Ricardo Signes wrote:
> > Porters,
> > 
> > Here's what I think, on the matter of eliminating that pesky magic true value.
> 
> And here's what I think.

I think  you and I are in agreement, except for one small matter:  I think that it'd be useful to say "module evaluated to false, despite having at some point enabled yield true, which probably indicates a mistake."  If this ends up being onerous, I think it's something we can do without.  But I think it will help users who do what Ovid mentioned doing:  writing all their code in a block.  The feature under discussion is the only one that would really be affected by writing your code that way.  That's why I think it's plausible it's happening.

Why don't we start with just implementing the basic feature and then we have a year to think more about the warning if we want. 🙂

Also, we know it needs a name.  I suggest 'module_true'.  If the feature is on, then this module will be treated as evaluating true.  I don't want to say 'require_ignores_false' or something because that could imply it changes the behavior of "require" in this scope.

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