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

Re: Pre-RFC: yield true feature

Thread Previous | Thread Next
From:
Yuki Kimoto
Date:
June 13, 2022 04:18
Subject:
Re: Pre-RFC: yield true feature
Message ID:
CAExogxO9VD+82D1PgcjUNLAnzgq0mZPn_VAK9aBt8vnrWoFs1w@mail.gmail.com
2022-6-13 11:02 Yuki Kimoto <kimoto.yuki@gmail.com> wrote:

>
>
> 2022-6-11 3:22 Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> wrote:
>
>>
>>   3. The surrounding `require` would ignore *any* return value (whether
>>      implicit because of EOF, or explicit from `return`), and behave as
>>      if `true` had been returned
>>
>> Therefore I think we should go with option 3; which would involve
>> altering the implementation of `require` to just ignore the return
>> value of the loaded file if `feature 'yield_true'` was in effect by the
>> time it reached EOF and hadn't already thrown an exception by that time.
>>
>>
> A problem of 3 is that a new module which has no "1;" at the end can't be
> loaded from old codes.
>
>  I think 3 is good, however a little  adjustment is needed.
>

> Therefore I think we should go with option 3; which would involve
altering the implementation of `require` to just ignore the return
value of the loaded file if `feature 'yield_true'` was in effect by the
time it reached EOF and hadn't already thrown an exception by that time.

I think this seems to be the 4th choice from the perspective of both
changing "require" and implementing "yield_true" feature.

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