diff --git a/_01.Language-basics.sz b/_01.Language-basics.sz index f5d2fb7..532f789 100644 --- a/_01.Language-basics.sz +++ b/_01.Language-basics.sz @@ -185,6 +185,12 @@ The bindings closest to the hole are listed first: locals, then your own module' While a hole's type is still open, the other errors in the same definition are held back, since they are often caused by the hole. Once you fill it in, they show up. +@subsubsection{Unused definitions} + +The compiler warns about definitions nothing uses: a top-level @code{def} or @code{defun} that the module doesn't export and nothing in it reads, and a local binding (a @code{let}, a @code{def} in a body, a loop variable) that nothing in its scope reads. Dead code piles up quietly in a large program, and this keeps it from doing so. + +If you keep something on purpose, start its name with an underscore: @code{(def _registered (register!))}, or @code{(:for _ (range 0 n))} for a loop that just repeats. Parameters and pattern variables are not checked. + @subsubsection{Naming conventions} Bjolang follows scheme's naming conventiens. Predicates end with @code{?}. Mutating functions end with @code{!}. Conversions are written using @code{->}.