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

Pre-RFC: yield true feature

Thread Next
Neil Bowers
June 6, 2022 22:06
Pre-RFC: yield true feature
Message ID:
This is a retrospective Pre-RFC for a proposal from Curtis, for which he submitted a draft RFC[1]. We nearly missed it when reviewing proposals in-flight in our PSC meeting last week, and decided to trigger a discussion here, to reinforce the process.

Beginning and casual Perl programmers regularly get confused / caught out by the requirement to add `1;` at the end of their modules. To add to their confusion, there are plenty of modules on CPAN with humorous alternatives for "1".

Curtis proposed a feature called something like yield_true, which would result in the current file yielding a true value on successful compilation. So a module could then look like this:

	package Zork;
	use feature 'yield_true';

	# code

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

There’s a module called `true` on CPAN, which provides this[2].

Would this start off experimental? Hopefully not.



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