mathport icon indicating copy to clipboard operation
mathport copied to clipboard

DECapitalize

Open jcommelin opened this issue 2 years ago • 2 comments

We should have a function that decapitalizes initial clusters of uppercase letters, as that's how the naming convention works.

See also: https://github.com/leanprover-community/mathport/pull/219/files/c1690c803df3b33db0fae93d1e911245a78444fd#r1081895321

jcommelin avatar Jan 20 '23 04:01 jcommelin

I think the actual algorithm here should be:

  • If the name begins with three or more capital letters followed by non-capital letters, then decapitalize all but the last of the leading capital letters (e.g. GCDMonoid -> gcdMonoid).
  • Otherwise, decapitalize all of the leading string of capital letters (e.g. SMul -> smul, XYZ -> xyz -- I don't think we have any names like that yet, but we might in the future).

rwbarton avatar Jan 20 '23 15:01 rwbarton

Note that hAdd etc. from core do not follow this convention.

rwbarton avatar Jan 31 '23 17:01 rwbarton