lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

chore: use ' instead of brackets for quotes

Open JovanGerb opened this issue 1 year ago • 5 comments

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.

JovanGerb avatar Jun 16 '24 10:06 JovanGerb

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.

JovanGerb avatar Jun 16 '24 11:06 JovanGerb

Mathlib CI status (docs):

Here both quotes are even used in the same error: https://github.com/leanprover/lean4/blob/0448e3f4ea1b2c476fc79aeee5d407971a1cd9e2/src/lake/Lake/Load/Package.lean#L31

JovanGerb avatar Jun 16 '24 11:06 JovanGerb

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.

nomeata avatar Jun 16 '24 12:06 nomeata

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.

leodemoura avatar Jun 17 '24 16:06 leodemoura