Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DECapitalize #222

Open
jcommelin opened this issue Jan 20, 2023 · 2 comments
Open

DECapitalize #222

jcommelin opened this issue Jan 20, 2023 · 2 comments

Comments

@jcommelin
Copy link
Member

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

@rwbarton
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants