S₁ naming conventions

S₁ is a very low-level language, and you often find yourself having to create temporary values that carry across the operations that you want to perform. We use standardized parameter names and “sigils” — printable, non-alphanumeric symbols at the start of many identifiers — to make it easier to construct identifiers that don’t overlap with each other, without having to jump through hoops to find synonyms for the names of the things that we’re operating on.

$_

returned receiver: When you invoke an invokable’s branch, that branch will often return the invokable back so that you can use it again. We call this output a returned receiver, and always use the special $_ name for it.

$0, $1, …

positional parameters and outputs: When a method wants to receive or produce values without providing a descriptive name, it will use these numeric identifiers to indicate “positional” parameters.

some_identifier

imported modules and named parameters and results: Identifiers with no sigil represent the other modules that a module imports, and are used to pass values into and out of invokables.

$some_identifier

continuations: An invokable that’s passed in as a parameter, and which doesn’t represent a “value” but is instead used to represent the program’s control flow. Most invokables only have a single outgoing control flow path, which is typically represented by a continuation parameter named $return.

!some_identifier

temporary local values: These are purely local to a single S₁ branch. You will always have to rename these values to some other name before passing them in as an input to an invokable.

@some_identifier

encapsulated state: The @ sigil is meant to evoke Ruby’s notation for instance members. These will be part of the containing clause of an S₁ block.