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

Re: Pre-RFC: yield true feature

Thread Previous | Thread Next
From:
Dan Book
Date:
June 9, 2022 03:32
Subject:
Re: Pre-RFC: yield true feature
Message ID:
CABMkAVXJ6zF_tUH_Y76ga94mksg6h8=kaj6sAMD3Np0Wev46kw@mail.gmail.com
On Wed, Jun 8, 2022 at 10:56 PM Oodler 577 <oodler577@sdf-eu.org> wrote:

> * Yuki Kimoto <kimoto.yuki@gmail.com> [2022-06-08 17:47:27 +0900]:
>
> > 2022-6-8 0:56 Dan Book <grinnz@gmail.com> wrote:
> >
> > > On Tue, Jun 7, 2022 at 5:06 AM Darren Duncan <darren@darrenduncan.net>
> > > wrote:
> > >
> > >> What would the effect of yield_true be on a Perl source file used as
> > >> simple
> > >> configuration data like the following, which I have actually
> practiced...
> > >>
> > >
> > > No effect. This is only for require (and thus use).
> > >
> > > -Dan
> > >
> >
> > "yield_true" feature doesn't affect "do".
> >
> > Does this mean "yield_true" is not simple syntax sugar at the end of "1"?
>
> This is beginning to sound like Test::More.
>
>     use Test::More tests => 42;
>     ...
>
> or
>
>     use Test::More;
>
>     ...
>
>     done_testing;
>
> So maybe follow that kind of pattern. But I am still lost why
> typing "use feature 'yield_true';" is better than "1;".
>

> This is not a feature we’d expect people to use explicitly, but would be
part of the version bundle, so you’d get it for free with a future `use
v5.XY`.

-Dan

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