next up previous contents index
Next: Dynamic Type Inference Up: Type Inference Previous: Global Function Type Inference   Contents   Index


Operation Specific Type Inference

operation specific type inference arithmetic type inference type inference

Many of the standard Common Lisp functions have special type inference procedures that determine the result type as a function of the argument types. For example, the result type of aref is the array element type. Here are some other examples of type inferences:

(logand x #xFF) $\Rightarrow$ (unsigned-byte 8)

(+ (the (integer 0 12) x) (the (integer 0 1) y)) $\Rightarrow$ (integer 0 13)

(ash (the (unsigned-byte 16) x) -8) $\Rightarrow$ (unsigned-byte 8)



Peter Van Eynde 2000-02-08