In some programming languages, how a symbol is capitalized has an effect on how the language is parsed (above and beyond the trivial case of keywords in a case-sensitive language; just because "class" is a C++ keyword and "Class" is not isn't sufficient to trigger mention here). Coding conventions not enforced by the compiler (i.e. declaring C macros in ALL_CAPS) don't belong here.
Obviously, case-insensitive languages like PascalLanguage won't be listed here.
Examples:
- SelfLanguage (see SelfUsesCapitalizationForSyntax): The first word in a KeywordMessage? is in lower-case; subsequent words are in upper-case, allowing Self to nest such messages without parentheses.
- HaskellLanguage: The names of types are capitalized, variables which range over types are in lower case. Integer -> Bool is the type of a function which takes an integer and returns a boolean; a -> Bool is the type of a polymorphic function that can take any type and returns a boolean. Also, functions and name-bound expressions must start in lower-case.
- PrologLanguage, ErlangLanguage: Variables are capitalized, the names of rules and terms are given in lower-case.
- ObjectiveCaml: Type and module names are capitalized, function and variable names are lowercase. Since a module name usually equals a file name, all source files have to start with a lowercase letter or else things get Interesting.
- RubyLanguage: Capitalized names are constants and lower-case names are variables. The Ruby interpreter uses this to resolve the scope of the variable. I.e., "MY_CONSTANT = 4" in Ruby is roughly the same as "global my_constant; my_constant = 4" in Python.
Related to SyntacticallySignificantWhitespaceConsideredHarmful
CategorySyntax