Next: , Up: descriptors   [Contents][Index]


4.1 Retrieving type descriptors

The following syntactic bindings are exported by the library (vicare).

Syntax: type-descriptor ?type-annotation

Expand to an expression which, compiled and evaluated, results in the type descriptor of the specified type annotation.

(type-descriptor <fixnum>)
→ <fixnum>-ctd

(type-descriptor (list <fixnum> <flonum>))
→ (make-list-type-descr (list <fixnum>-ctd <flonum>-ctd))

Internally, first an expand–time type specification is built; then the type descriptor is built from the specification.

Function: type-descriptor-of obj

Return the type descriptor of obj.

(type-descriptor-of +1)         ⇒ <positive-fixnum>-ctd
(type-descriptor-of "ciao")     ⇒ <nestring>-ctd