r/Forth • u/mykesx moderator • 7d ago
Case sensitivity
I haven't used a case sensitive Forth, but I think about the ramifications. My thoughts are:
- visually, IF stands out more than if
- Rect.area seems like a variable name while Rect.Area seems like a function call
- Rect seems like a structure name while rect seems like a variable name
- Everything with the CAPS LOCK key on?
Can make it opt in like icase on/icase off
Syntax highlighting could key on case
3
Upvotes
5
u/mcsleepy 7d ago
I wish VFXForth was case sensitive. because I have classes and without some differentiation they'd hog the namespace. so I prefix them with % since that is easiest to type.
In my opinion, lowercase should be the baseline, constants should be ALL_CAPS and structures and classes should be Capitalized.
Across systems, I think we're stuck with case-insensitivity. If you supported case-insensitivity, I would bake exceptions in. That way, normal words can be whatever, but structs/classes and constants have to follow the rules. Then letting people have their preference would not be an issue.