(((name . "cond-thunk") (signature syntax-rules (else) ((_ clause ...))) (subsigs (clause (pattern (expr clause ...) (else expression1 expression2 ...))) (expr (or (lambda () *) #f))) (desc " * It is an error if `expr` does not evaluate to a thunk or to `#f`. If `expr` evaluates to a thunk, then the thunk is tail-called as the result of the expression. Otherwise the macro evalates the next clause. If the `else` clause is reached, the expressions in the clause are evaluated as the result of the expression. If there is no `else` clause and all `expr` fail, then `cond-thunk` returns #f.")) ((name . "any-thunk") (signature case-lambda ((list? thunks) *) ((list? thunks) (procedure? else-thunk) *)) (desc " * It is an error if `thunks` is not a proper list of thunks that return either `#f` or another thunk. * It is an error if `else-thunk` isnot a thunk. This function is a procedural version of `cond-thunk`. Evaluate each `thunk` in `thunks` in order. If the `thunk` evaluates to a thunk, the thunk is tail-called. Otherwise evaluate the next thunk in the list. If all `thunks` evaluate to `#f`, then `else-thunk` is tail called. If `else-thunk` is not supplied, the function returns `#f`.")) ((name . "when-ct") (signature syntax-rules ((_ conditional body ...))) (desc " * It is an error if `formal` is not a lambda formal. * It is an error if `conditional` is not an expression. If `conditional` is true, return a thunk that when called executes `body ...`. Otherwise return `#f`.")) ((name . "lambda-ct") (signature syntax-rules ((_ formal conditional body ...))) (desc " * It is an error if `formal` is not a lambda formal. * It is an error if `conditional` is not an expression. Create a closure with arguments `formal` that evaluates `conditional`. If `conditional` returns a truthy value, a thunk closure with `body ...` as its body is returned. Otherwise the closure returns `#f`.")) (name . "define-ct") (signature syntax-rules ((_ (name . formal) conditional body ...))) (desc " * It is an error if `formal` is not a lambda formal. * It is an error if `conditional` is not an expression. Define a procedure `name` as a conditional generating a thunk. See `lambda-ct` for more details."))