All Manuals > LispWorks Delivery User Guide > 13 Efficiency considerations when coding for delivery > 13.6 Avoid referencing type names

NextPrevUpTopContentsIndex

13.6.2 Referencing types via predicates

If you do not wish to retain CLOS, and are referencing types that have built-in predicates, or structure types, you could use these predicates instead of the type names to allow delivery to remove unused types. For example this code:

(typecase x
  (integer (process-an-integer x))
  (string (process-a-string x))
  (a-struct (process-a-struct x)))

could be rewritten as:

(cond ((integerp x) (process-an-integer x))
      ((stringp x) (process-a-string x))
      ((a-struct-p x) (process-a-struct x)))

LispWorks Delivery User Guide - 13 Dec 2011

NextPrevUpTopContentsIndex