Dynamic Type Checking
The type of each piece of runtime data can be determined.
The application program tests the type of the
data before performing operations on it.
(defun copy-tree (x)
(if (atom x) x
(cons (copy-tree (car x))
(copy-tree (cdr x))) ))
Advantages:
- Flexibility: The same code can work with many kinds of data.
Disadvantages:
- Speed: Need to test types repeatedly at runtime. Hardware support
can help this problem.
- Verifiability: Harder to verify that a program will work for all
combinations of data types.
Contents
Page-10
Prev
Next
Page+10
Index