Derived syntax forms: cond, case, when, unless, letrec.
These are operatives that extend the core syntax.
whenEvaluate body forms when test is true.
Parameters:
ANY — Expression to evaluate as a booleanANY — One or more body expressionsunlessEvaluate body forms when test is false.
Parameters:
ANY — Expression to evaluate as a booleanANY — One or more body expressionsletrecRecursive let: all bindings are visible to each other, enabling mutual recursion.
Parameters:
LIST — List of (name value) binding pairsANY — One or more body expressionsletBind local variables and evaluate body.
Named let: (let name ((var init) …) body) creates a loop.
Parameters:
LIST — ((name value) …) binding pairsANY — Body expressionExamples:
(let ((x 1) (y 2)) (+ x y)) => 3
(let loop ((n 5) (acc 1)) (if (= n 0) acc (loop (- n 1) (* acc n)))) => 120See also: letrec
condMulti-way conditional: evaluates clauses in order, returning the body of the first true test. Supports else and => syntax.
Parameters:
LIST — List of (test body…) clauses; use else for defaultcaseDispatch on a value: evaluates key, then matches against datum lists in each clause.
Parameters:
ANY — Expression to evaluate and match againstLIST — List of ((datum …) body…) clauses; use else for default