in reply to OO design question

Read the description of the Builder Pattern in the Design Patterns book. This should do what you want.

Basically:

Alternatively, and much cooler, you can solve this problem in the CLOS (Common Lisp Object System) way by using Damian Conway's module Class::Multimethod. This module allows you to have dynamic dispatching based on the type of multiple arguments.

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com