LispWorks Delivery User Guide > 3 Writing Code Suitable for Delivery > 3.2 Efficiency considerations when coding for delivery > 3.2.6 Avoid referencing type names

NextPrevUpTopContentsIndex 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 - 22 Dec 2009