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 18, 2022 03:10
Subject:
Re: Pre-RFC: yield true feature
Message ID:
587c498f-16eb-448e-b674-d79be106c436@www.fastmail.com
On Fri, Jun 17, 2022, at 23:00, Darren Duncan wrote:
> 1.  Treat the "yield true" feature like how we treat explicit declarations of 
> file encoding, in that they are explicitly NOT lexical, and that having one 
> anywhere in a file causes it to apply to the entire file, and/or it is only 
> legal for the declaration to exist at the top level of a file and not inside any 
> block.

What are you referring to when you say "how we treat explicit declarations of file encoding"?

> 4.  We also add the ability, if it isn't already allowed, one to use explicit 
> "return" statements at the top level of a file.

This already exists as can be trivially verified:
$ echo 1 > foo.pm
$ echo "return 0; 1" > bar.pm
$ perl -I . -Mfoo -e0
$ perl -I . -Mbar -e0
bar.pm did not return a true value.
BEGIN failed--compilation aborted.

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