Function: deftype

deftype is a function alias for cl-deftype, defined in cl-macs.el.gz.

This macro is obsolete since 27.1; use cl-deftype instead.

Signature

(deftype NAME ARGLIST &rest BODY)

Documentation

Define NAME as a new, so-called derived type.

The type NAME can then be used in cl-typecase, cl-check-type, etc., and to some extent, as method specializer.

ARGLIST is a Common Lisp argument list of the sort accepted by cl-defmacro. BODY forms should return a type specifier that is equivalent to the type (see the Info node (cl)Type Predicates).

If there is a declare form in BODY, the spec (parents . PARENTS) can specify a list of types NAME is a subtype of. The list of PARENTS types determines the order of methods invocation, and missing PARENTS may cause incorrect ordering of methods, while extraneous PARENTS may cause use of extraneous methods.

If PARENTS is non-nil, ARGLIST must be nil.

Aliases

deftype (obsolete since 27.1)