9.3.2 Method dispatch and singletons
When a type is a singleton, Dylan uses the following rules:
1. An object is an instance of a singleton only if the object is identical to the object used as the argument in the call to singleton that created the
singleton.
2. A singleton is a proper subtype of any other type that the object belongs to. Thus, a singleton is more specific than any other type of which an object is an instance. In particular, a singleton is more specific than the object's class.
For example, suppose that we have these definitions:
// Method 1 define method say (x :: <integer>) ... end method say; // Method 2 define method say (x == 0) ... end method say;
Note that method 2 illustrates a convenient syntax for defining a method on a singleton without calling singleton explicitly.
Now, if say is called with an argument of 0, both methods are applicable, and method 2 is more specific than method 1. If say is called with an argument that is any other integer, only method 1 is applicable.




