Open fecundf opened 3 years ago
Thanks. We'll do our best to try and fix this.
Thanks for the eyes on this! Please share thoughts, I would like to know reasoning behind any changes or not, and happy to think more & discuss this bit of Raku-ness.
The initial discussion about this issue was on the perl6-users list, "Checking for nil return":
https://www.nntp.perl.org/group/perl.perl6.language/2020/12/msg36850.html
Sorry, I meant the perl6-language list (and github isn't letting me edit old comments now).
There was some discussion there about distinguishing between the output channel and the error channel. Myself I think there is a problem with the current behavior: the return value from a routine is something you would expect the programmer to be in complete control over, having a special value that you're restricted from messing with seems very strange...
Confusing second Nil meaning
Nil is defined as being both "Absence of a value" and also "a benign failure," but the documentation does not justify or give examples of the "benign failure" sense.
I and at least one other beginner see the value in "Absence of a value" but not the "Benign failure" case, and have tripped on attempting to create a return signature that specifies a non-Nil return, eg "block always returns a value."
Suggestions
(edit) FYI commit that documented the additional "benign failure" sense is at https://github.com/Raku/doc/commit/2b3c920ae9c37d14f76ab1eab236df2ec4f513ec