chickadee » messages » define-abstract-type

(define-abstract-type Child Parent .. variant .... (with clause ....))syntax

defines a hidden algebraic type with variant .... and exports two procedures, the type predicate Child? and a parametrized procedure Child, which, when called with key #:? returns the type predicate, wenn called with another key argument returns the corresponding procedure (Child key) ... , when called without argument returns documentation of all those procedures.

All the procedures are specified in each clause .... either as

  • ((key (x x? ...) ...) body ....)

or

  • ((key (x x? ...) ... xs xs? ...) body ....)

Note that the first list in each clause looks like a variant in the algebraic type.

As in algebraic types, a specialisation of case-variant, Child-case, is generated as well.