1. Overview#
1.1. How rules are written#
Each rule of the spec is stated once, in a numbered box. Rules are numbered by page: Rule 2.1 is
the first rule of page 2. A rule has a label as well as a number, and the spec and the errors of the
compiler cite a rule by its label (Rule 2.22), so a citation keeps working when
rules are added or moved. For example, the rule with the label declare-before-use is
stated in Names and scope, and Rule 6.3 is a citation of it.
1.2. Terms#
Every term the spec defines is in the Glossary.
1.3. Examples#
Every example in the spec is compiled while the spec’s pages are built, and an example that does not compile stops the build. Each is shown as its source, then live:
; a point on a segment, and a slider and a drag that move it
(scene s
(real a 1 (>= 0) (<= 4))
(line track (from [0 0]) (to [4 0]) (stroke 'gray'))
(circle p (pos [a 0]) (r 0.15) (fill 'crimson')))
(canvas v (x -0.5) (y -0.5) (width 5) (height 1) s
(on-drag p (move a (to pointer.x))))
(slider push (move a (from 0) (to 4)) (label 'a'))
(readout r $'a = {a:.2f}')