Skip to content

Returns signature check gets Nil, skip or run #3760

@fecundf

Description

@fecundf

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

  1. Use the Failure type (undefined Failure) as "benign failure," and revert Nil to its pre-2016 sense as being "Absence of a value" solely
  2. OR explain the reasons to have Nil as an uncatchable return value, in addition to being an absence placeholder– why is it a Raku-ish helpful duality?

(edit) FYI commit that documented the additional "benign failure" sense is at 2b3c920

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation issue (primary issue type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions