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

Re: Pre-RFC: yield true feature

Thread Previous | Thread Next
Yuki Kimoto
June 9, 2022 06:07
Re: Pre-RFC: yield true feature
Message ID:
2022-6-7 9:40 Dan Book <> wrote:

> But there's also another option: we could do both. Though it seems a
> little unnecessary for such a trivial feature.
> -Dan

 I write the idea that the effect is as little as possible.

A flag "REQUIRE_NOT_CHECK_RETURN_VALUE" is added to the block (file scope)
of loaded file in the feature "yeald_true".

  op_file_scope_block->flag |= REQUIRE_NOT_CHECK_RETURN_VALUE

And if "require" finds the flag "REQUIRE_NOT_CHECK_RETURN_VALUE" in the
feature "require_not_check_return_value", "require" doesn't see the return

  package Foo;
  use feature 'yeald_true';


  use feature 'require_not_check_return_value';
  require Foo;

If a user want the original behavior of "require", he do "no feature

  no feature 'require_not_check_return_value'
  require Foo;

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