Dylan also allows functions to dispatch on specific objects. For example, state inspectors might pass the governor's car without actually looking at it. Dylan expresses this situation using singletons, objects which are treated as though they were in a class of their own. For example:
define constant $governors-car = make(<car>); define method inspect-vehicle(car == $governors-car, i :: <state-inspector>) => (); wave-through(car); end;
(In this example, none of the usual inspection methods will be invoked since the above code neglects to call next-method .)