leanprover / leanprover/reference-manual

confusing wording of "tail position" description

Open
#281 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
129
Forks
67
Avg merge
1d 15h
Merged PRs (30d)
16

Description

Describe the error

The wording describing what "tail position" means is confusing.

Quote

An expression is in tail position in the function body if it is:

  • the function body itself,

  • the branches of a match expression that is in tail position,

  • the branches of an if expression that is in tail position, and

  • the body of a let expression that is in tail position.

Why is it incorrect and/or confusing?

The wording starts out as "an expression is in tail position if it has one of the following properties", resulting in a disjunctive enumeration, while it ends in a conjunctive enumeration (as evidenced by the word "and" as well as the use of plural.)

I would suggest one of the following options:

option 1 (disjunctive list of conditions)

An expression is in tail position in the function body if it is:

  • the function body itself,

  • a branch of a match expression that is in tail position,

  • a branch of an if expression that is in tail position, or

  • the body of a let expression that is in tail position.

option 2 (conjunctive list of all options)

The following kinds of expression are in tail position:

  • the function body itself,

  • the branches of a match expression that is in tail position,

  • the branches of an if expression that is in tail position, and

  • the body of a let expression that is in tail position.

note that with option 2, "in the function body" is removed from the header of the list. I couldn't find a nice wording that keeps that bit, but as a result i'm not sure that the meaning is as clear and/or still correct. If i am the person writing the PR for this, i will want a second opinion (other than myself), as i am not a native speaker.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the quoted tail-position passage and compare its list structure with the surrounding explanation and linked match and if documentation. Choose a consistent singular or plural wording, preserve the intended meaning, and confirm that the revised passage reads clearly in context.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.