Laurel User Guide

2.4. Reserved names🔗

A leading $ is reserved for compiler-generated names, and this is enforced across a whole program: a declaration whose name begins with $ — a type, procedure, parameter, field, local, bound variable, constructor or block label — is rejected with a diagnostic on the declaration itself. A $ anywhere else in a name is an ordinary identifier character, so total$1 is legal and needs no avoidance.

The sole exception is $result, the name the short procedure f(…): T return form gives a procedure's single output. You may spell it out in an explicit returns ($result: T) clause and refer to it in contracts, but you may not use it for anything else.

The always-on prelude also occupies a handful of unprefixed names, because they are the built-in types and operations: TotalMap, Map, Set, Sequence, select, update, mapConst, mapEmpty, mapContains, mapGet, mapSet, mapRemove, and the set* and seq* families. A program using composites also has compiler-generated helper names in scope. Redeclaring any of these is accepted by the parser and then fails during resolution.