| In a data file, I have a list of shapes. As I traverse this list, I would like to call one (or more) routines specific to the type of shape. For example, for a 'sphere' object, I would want to call 'sphere-intersect' and 'sphere-normal' while I might want to call 'plane-intersect' and 'plane-normal' for a 'plane' object. Ideally, I'd like to just call 'intersect' with the object and automatically call the appropriate intersection routine (eg, sphere-intersect). This could be solved by storing the function name within the object description. I'd rather not, since I would then have to modify the format of the data file any time I changed the corresponding function names in the source. I'm new to lisp-like languages in general, so this may be a basic question, but how would I approach this in arc? |