In the current Modelica specification; the only admitted external entities are memory-less functions. We propose an extension to allow parts of the model containing internal states; conditioning and discrete dynamics; to be definable as external functions. This opens the door to separate compilation of Modelica code. For this purpose; we introduce the language construct switchwhen and the type Event. These extensions are directly inspired by the Scicos formalism.