This section describes the (r6rs when-unless)library.
Syntax: <Test> must be an expression. Semantics: A when expression is evaluated by evaluating the <test> expression. If <test> evaluates to a true value, the remaining <expression>s are evaluated in order, and the result(s) of the last <expression> is(are) returned as the result(s) of the entire when expression. Otherwise, the when expression evaluates to the unspecified value. An unless expression is evaluated by evaluating the <test> expression. If <test> evaluates to false, the remaining <expression>s are evaluated in order, and the result(s) of the last <expression> is(are) returned as the result(s) of the entire unless expression. Otherwise, the unless expression evaluates to the unspecified value.
(when (> 3 2) ’greater) ===⇒ greater
The when and unless expressions are derived forms. They could be defined in terms of base library forms by the following macros:
(define-syntax when
This section describes the (r6rs case-lambda)library.
Syntax: Each <clause> should be of the form
(<formals> <body>)<Formals> must be as in a lambda form (report section on “Procedures”), <body> must be a body according to report section on “Bodies and sequences”.
Semantics: A case-lambda expression evaluates to a procedure. This procedure, when applied, tries to match its arguments to the <clause>s in order. The arguments match a clause if one the following conditions is fulfilled:
<Formals> has the form (<variable> ...) and the number of arguments is the same as the number of formal parameters in <formals>.
<Formals> has the form
(<variable1> ...<variablen> . <variablen+1)>
and the number of arguments is at least n.
<Formals> has the form <variable>.
For the first clause matched by the arguments, the variables of the <formals> are bound to fresh locations containing the argument values in the same arrangement as with lambda.
If the arguments match none of the clauses, an exception with condition type &assertion is raised.
(define foo
A sample definition of case-lambda in terms of simpler forms is in appendix 18.
The procedures described in this section are exported by the (r6rs programs)library.
Returns a list of strings with at least one element. The first element is an implementation-specific name for the running top-level program. The following elements are command-line arguments according to the operating system’s conventions.
Exits the running program and communicates an exit value to the operating system. If no argument is supplied, the exit procedure should communicate to the operating system that the program exited normally. If an argument is supplied, the exit procedure should translate the argument into an appropriate exit value for the operating system.