Object Orientation

Unlike many other object-oriented languages, Dylan uses objects for every data value. Integers and strings are objects, as are functions and classes themselves.

Dylan's design makes this reasonably efficient. Compile-time analysis and explicit type declarations allow the compiler to optimize away most of the overhead. Other language features permit the programmer to mark certain classes as sealed, that is, inelligible for further subclassing.

Dylan's object model, detailed in the following sections of this tutorial, differs from that of C++ in several important respects. Multiple inheritance may be used freely, without concern for object slicing, erroneous down-casting or a whole host of other gotchas familiar to C++ programmers. Methods are separate from class declarations, allowing a programmer to write new polymorphic functions without editing the relevant base class. Methods may also dispatch ploymorphically on more than one parameter, a powerful technique known as multiple dispatch. All of these features will be explained in greater detail later on.