squiggle
squiggle copied to clipboard
Allow uppercase identifiers in Squiggle
Reasons:
- We've allowed them by accident in 0.9.0 and 0.9.2, and some models on Squiggle Hub are stuck on those versions.
- we could handle this manually by emailing authors, but that's annoying to do
- We already have
String(...),Calculator(...)etc. function on Squiggle.- It's possible that after we get structs we could convert these to constructors, but it's hard to tell if that's the case.
- The arguments in favor of lowercase-only identifiers are kind of weak:
- Coding style - other languages (Python, JS) don't do this and they're fine; allowing uppercase is not any worse than allowing
camelCaseandsnake_case- OTOH, our error reporting is mediocre and users could get confused
- Reserving
UpperCamelCasefor some future feature, e.g. structs - I think for structs we're fine as is; and for some other low-level namespace for those, we could always fallback to weird sigils, e.g.$foo(I don't expect we'll need this though)
- Coding style - other languages (Python, JS) don't do this and they're fine; allowing uppercase is not any worse than allowing
I think I'm happy to add them back in. Could become a decent style for custom-made libraries and the like.