LispWorks Delivery User Guide > 3 Writing Code Suitable for Delivery > 3.2 Efficiency considerations when coding for delivery

NextPrevUpTopContentsIndex

3.2.6 Avoid referencing type names

Referencing the name of a type (that is, a symbol) in code means that delivery cannot remove that type even if it is not used anywhere else. This is often seen in code using typep , typecase or subtypep to discriminate between types.

For example, if you have code like this:

(defun foo (x)
  (cond ((typep x 'class1) ...)
        ((typep x 'class2) ...)
        ...
        ((subtypep x 'class1000) ...)))

then delivery would keep all of the classes class1 , ... , class1000 even if nothing else references these classes.

Possible solutions are described in Referencing types via methods and Referencing types via predicates.

3.2.6.1 Referencing types via methods

3.2.6.2 Referencing types via predicates


LispWorks Delivery User Guide - 22 Dec 2009

NextPrevUpTopContentsIndex