:

[syntax] : vars arg1 arg ...

SRFI-42: First the expressions arg1 arg ... are evaluated into a[1] a[2] ... a[n] and then a global dispatch procedure is used to dispatch on the number and types of the arguments and run the resulting generator. Initially (after loading the SRFI), the following cases are recognized:

:list

if for all i in {1..n}: (list? a[i]).

:string

if for all i in {1..n}: (string? a[i]).

:vector

if for all i in {1..n}: (vector? a[i]).

:range

if n in {1..3} and for all i in {1..n}: (integer? a[i]) and (exact? a[i]).

:real-range

if n in {1..3} and for all i in {1..n}: (real? a[i]).

:char-range

if n = 2 and for all i in {1, 2}: (char? a[i]).

:port

if n in {1,2} and (input-port? a[1]) and (procedure? a[2]).

The current dispatcher can be retrieved as (:-dispatch-ref), a new dispatcher d can be installed by (:-dispatch-set! d) yielding an unspecified result, and a copy of the initial dispatcher can be obtained as (make-initial-:-dispatch). Please refer to the section below for recommendation how to add cases to the dispatcher.