| TypeSelector.ig and TypeSelector.mg generate a Selector proc (see MGV.i3) which iterates over all elements in the current MG VBT and finds the element that is a subtype of Type that is closest to the selection point.
INTERFACE Piddly; IMPORT <Some interface with an interesting type>; TYPE Type = <interface>.<MG.T subtype>; END Piddly.
INTERFACE PiddlySelector = TypeSelector() END PiddlySelector.
MODULE PiddlySelector = TypeSelector(Piddly) END PiddlySelector.
zeus view implementation:
... PROCEDURE Install(view: T) = VAR v := NEW(<MGV.V subtype>, selector := PiddlySelector.closest, ...).init(...) BEGIN View.T.install(view); ... END Install; ...
TypeSelector(); IMPORT MGV; VAR closest: MGV.Selector; END TypeSelector.