variable-naming-convention


From RnRS

This is the baseline naming convention that RnRS has specified.

procedure?

predicate, returns a boolean value

procedure!

has significant side effects (e.g., set-car! assigns the car of a pair)

foo->bar

type/representation conversion from foos to bars, such as string->number

Other conventions

*variable*

a global, mutable variable/parameter

%procedure

a low-level procedure

namespace:name

for explicitly noting the namespace from which a name comes, typically only when there would otherwise be significant ambiguity or when the name is intended to be hidden

:

Is used as prefix and postfix for keywords, and infix for field accessors in records.

CONSTANT

constant binding -- note, though, that, although the languages from which this convention originates will distinguish these names, the case of written symbols in Scheme is not preserved (only for R5RS and earlier; symbols in R6RS are case-sensitive)

+constant+

also used to denote constants; used in Common Lisp

*Name

'includes the internal logic, which the non-* version is just a wrapper around that frobnicates (tweak) the inputs first

Name*

Implies a lower-level procedure, to denote a slight variation on the non-asterisked procedure or special form, to denote an internal routine

variable%

Also implies a lower-level procedure

X/Y

is usually a constant named Y of a set of such constants each related by some common theme of X (e.g., TAG/FIXNUM, TAG/IMMEDIATE, TAG/HEADER, TAG/POINTER) or an abbreviation of with (e.g. call-with-current-continuation).

:

Also used to specify a namespace

< ... >

Is used to denote class names (See object-oriented-programming)

$name

(Dylan) a global constant binding

$name

(Scheme48) the name of a variable bound to a fluid, essentially a dynamically scoped entity

name%

(plt-scheme) Class

name<%>

(plt-scheme) interface

name@

(plt-scheme) Unit, especially a signed unit

name^

(plt-scheme) unit signature


category-learning-scheme