Identifiers - Spicery/Nutmeg GitHub Wiki

Syntax

Identifiers in Nutmeg are like those in the majority of other programming languages. They start with optional underscores, a letter and continue with letters, underscores or digits. Like other modern languages they can draw from the huge range of letters made available in Unicode - as the default character encoding for Nutmeg source code is UTF-8 (no byte-order mark).

Note: In future expansions of Nutmeg (should the language be popular enough to merit them!) identifiers will be allowed to be completely arbitrary strings.

Discards

Identifiers that start with an underscore are special in the sense that they represent discards (cf. C# discards). The subsequent characters have no significance but are purely intended to help the programmer name their discard helpfully.

Non-Overloaded Names

Unlike almost all modern languages, Nutmeg identifiers represent variables and nothing else. There is no overloading allowed for classes, methods or instance-variables. Class names are variables that are bound to class-objects. Method names are variables that are bound to method-objects. Variable names are variables that are bound to objects.

This is a desirable property for more sophisticated forms of programming, such as higher order programming, because we want to be able to abstract (parameterise) over any language feature.