Typographic Conventions
-
Definition terms are printed in fixed-width bold face:
cents->scaler
-
Literals and programming code are printed in fixed-width face:
(list (note 60) (rhythm 'h.))
-
Variables and metavariables (names that stand for pieces of code) are printed in italic face:
number
- Terms separated by | are exclusive choices, that is, exactly one must apply:
number | boolean
-
Braces { } and brackets [ ] are sometimes used to associate or group the enclosed terms. They are never written in actual code.
-
Braces group the enclosed terms into a single entity. Thus:
{number | boolean}
describes single value that is either a number or a boolean.
-
Brackets make the enclosed term optional. An optional term may appear
at most one time. For example, in the following definition:
(
odds
prob [trueval] [falseval])
(odds .5) (odds 1 'win) (odds .2 "Yup" "Nope")
-
Braces group the enclosed terms into a single entity. Thus:
-
A star * after a brace means that the enclosed terms may be specified
zero or more times. For example:
(
new
class {keyword value}*)
(new midi)
(new midi :time 10)
(new midi :keynum 22 :duration 3) -
A plus + after a brace means that the enclosed terms may be specified one or more times.
-
A sequence of three dots means the rest of the arguments, no matter how many. For example:
(
pick
arg ...)
-
In coding examples evaluation is indicated using the right arrow:
⇒
keyword string special comment :music
"Hello, world"
loop
;; buggy!