Skip to content

Commit 697c901

Browse files
Ovidrjbs
authored andcommitted
Add RFC for "yield_true"
1 parent 5aaa892 commit 697c901

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

rfcs/rfc0018.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# A feature to automatically "yield true" at the end of a file
2+
3+
## Preamble
4+
5+
Author: Curtis "Ovid" Poe <[email protected]>
6+
Sponsor:
7+
ID: 0018
8+
Status: Draft
9+
10+
## Abstract
11+
12+
This RFC proposes a `yield_true` feature. When used, the current Perl _file_
13+
containing `use feature 'yield_true'l` will automatically return a true value
14+
after successful compilation, eliminating the neeed for a "1" (or other true
15+
value) at the end of the file.
16+
17+
## Motivation
18+
19+
Eliminate the need for a true value at the end of a Perl file.
20+
21+
## Rationale
22+
23+
There's no need to have a true value be hard-coded in our files that we
24+
`use`. Further, newer programmers can get confused because sometimes code
25+
_doesn't_ end with a true value but nonetheless compiles just fine because
26+
_something_ in the code returned a true value and the code compiles as a
27+
side-effect.
28+
29+
30+
## Specification
31+
32+
use feature 'yield_true';
33+
34+
Code using the above does not need to return a magic true value when compiled.
35+
36+
## Backwards Compatibility
37+
38+
There are no compatibility concerns I'm aware of.
39+
40+
## Security Implications
41+
42+
None expected.
43+
44+
## Examples
45+
46+
None. See above.
47+
48+
## Prototype Implementation
49+
50+
None.
51+
52+
## Future Scope
53+
54+
I believe this is complete.
55+
56+
## Rejected Ideas
57+
58+
None that I'm aware of.
59+
60+
## Open Issues
61+
62+
None that I'm aware of.
63+
64+
## Copyright
65+
66+
Copyright (C) 2022, Curtis "Ovid" Poe
67+
68+
This document and code and documentation within it may be used, redistributed
69+
and/or modified under the same terms as Perl itself.

0 commit comments

Comments
 (0)