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

Re: Pre-RFC: yield true feature

Thread Previous | Thread Next
Tom Molesworth via perl5-porters
June 16, 2022 05:06
Re: Pre-RFC: yield true feature
Message ID:
On Thu, 16 Jun 2022 at 12:29, Tony Cook <> wrote:

> Thinking about implementation, how should this behave if the included file
> was:
>   package Zork {
>       use feature 'yield_true';
>   }

Since it's called `yield_true` rather than `ignore_false`, I'd expect that
lexical scope to behave as if it was wrapped in `(...) or builtin::true`,
so the `require Zork;` would work as if it had been `package Zork;
builtin::true`. Similarly for nested scopes: behaving a bit like `perl
-le'print do { { { (undef) or 1 } } }'` with the true value propagating.
Presumably that would enforce scalar context: is that likely to be a


my $value = do { use feature 'yield_true'; undef }; # we're expecting
$value = builtin::true, yes?

This level of detail seems more appropriate for the RFC stage. Seems
there's enough interest to go beyond pre-RFC here?

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