In app.diesel:
The
generic_app
object is a place for libraries to put default
behavior that can be customized by individual applications.
The app variable is what libraries should refer to to get the current application object. Individual applications (and optional libraries too) should define children of
generic_app
that override the behavior of generic_app
, and update the
app variable to hold that object. Since the app variable's
type is just generic_app
, only generic operations are allowed
on app. For client-specific operations, the client-specific
objects should be referred to directly (or the client-specific
operations should have appropriate default behavior introduced
on generic_app
, and then overridden by the client-specific
operations).
For programs that have multiple ``applications'', e.g. the compiler which has two different versions of the typechecker ``application'', the
using_app
control structure can be used to
temporarily switch to a particular application object during
evaluation of a block of code.