<\body> For large software projects, it is important that different modules can be developed as independently as possible one from each other. Furthermore, fundamental modules often implement default behaviour which is to be overwritten in a more specialized module. In order to facilitate these two requirements, implements a system of . In order to get the main idea behind this system, consider the implementation of a given functionality, like hitting the return key. Depending on the context, different actions have to be undertaken: by default, we start a new paragraph; inside a table, we start a new row; etc. A naive implementation would check all possible cases in a routine and call the corresponding routine. However, this makes it impossible to add a new case in a new module without modifying the module which defines . By contrast, the system of contextual overloading allows the user to redefine the routine several times in distinct modules. For instance, assume that we want to define a function which inserts ``Hello'' by default, but ``>'' in mode math, while positioning the cursor between the brackets. Using contextual overloading, this may be done as follows: <\scm-code> (tm-define (hello) (insert "Hello")) (tm-define (hello) (:require (in-math?)) (insert-go-to "hello()" '(6))) \; The order in which routines are overloaded is important. first tries the latest (re)definition. If this definition does not satisfy the requirements (, in our case), then it tries the before last (re)definition, and so on until an implementation is found which matches the requirements. For example, if we invert the two declarations in the above example, then the general unconditional definition of will always prevail. If the two declarations are made inside different modules, then it is up to the user to ensure that the modules are loaded in an appropriate order. Inside a redefinition, it is also possible to access the former definition using the keyword . In particular, the code <\scm-code> (tm-define (hello) \ \ (if (in-math?) (insert-go-to "hello()" '(6)) (former))) is equivalent to the second declaration in our example. Contextual overloading generalizes more classical overloading on the types of the arguments, such as style polymorphism. Although one may overload on the types of the arguments, it is also possible to impose more general conditions on the arguments. For instance, one may sometimes wish to write the following kind of code: <\scm-code> (tm-define (my-replace what by) \ \ ) \; (tm-define (my-replace what by) \ \ (:require (== what by)) \ \ (noop)) Besides , several other added language primitives support the contextual overloading mechanism. For instance, and support overloading on mode. The and primitives are analoguous to.