Skip to content

chore: use ' instead of brackets for quotes#4464

Closed
JovanGerb wants to merge 1 commit into
leanprover:masterfrom
JovanGerb:quotingWithQuote
Closed

chore: use ' instead of brackets for quotes#4464
JovanGerb wants to merge 1 commit into
leanprover:masterfrom
JovanGerb:quotingWithQuote

Conversation

@JovanGerb

Copy link
Copy Markdown
Contributor

Bracket used for quoting an expression, such as (C ...) in

invalid {...} notation, {kind} type is not of the form (C ...){indentExpr type}

have been replaced by 'C ...'. This makes the messages clearer.

@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jun 16, 2024
ghost pushed a commit to leanprover-community/batteries that referenced this pull request Jun 16, 2024
ghost pushed a commit to leanprover-community/mathlib4 that referenced this pull request Jun 16, 2024

@nomeata nomeata left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to be consistent, but probably subjective which variant is clearer. I'd be curious what @david-christiansen will say.

Also, do we maybe use back ticks in some places as well?

@JovanGerb

Copy link
Copy Markdown
Contributor Author

Yeah, I wasn't sure about backticks vs single quotes. I went for normal quotes because they seem to be used more than backticks. I don't know of any difference in the meaning between the two.

@ghost ghost added the builds-mathlib CI has verified that Mathlib builds against this PR label Jun 16, 2024
@ghost

ghost commented Jun 16, 2024

Copy link
Copy Markdown

Mathlib CI status (docs):

@JovanGerb

Copy link
Copy Markdown
Contributor Author

Here both quotes are even used in the same error:

throw s!"unexpected type at '{const}', `{type}` expected"

@nomeata

nomeata commented Jun 16, 2024

Copy link
Copy Markdown
Collaborator

My impression, from looking at the lines of code in the diffs, is that single ticks are used to refer to a names and parentheses or backticks to quote expressions. Such semantic differentiation might actually be intended and useful, but then should be documented for the other developers so that we can apply them consistently.

@leodemoura

leodemoura commented Jun 17, 2024

Copy link
Copy Markdown
Member

It's good to be consistent, but probably subjective which variant is clearer. I'd be curious what @david-christiansen will say.

Also, do we maybe use back ticks in some places as well?

Me too. I feel like we are not using quotes and backticks consistently in error messages and doc-strings. I am also curious about what @david-christiansen will say. We should document the decision, and start enforcing from now on.

@leanprover-bot leanprover-bot added the P-medium We may work on this issue if we find the time label Aug 23, 2024
@JovanGerb JovanGerb closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR P-medium We may work on this issue if we find the time toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants