[E-Lang] Pet Extensions and such (was: what is good about E?)
Ka-Ping Yee
ping@lfw.org
Wed, 25 Jul 2001 16:30:10 -0700 (PDT)
On Wed, 25 Jul 2001, Ken Kahn wrote:
> I agree with MarcS (sorry about misspelling your name on the previous
> message) that Chris has a good idea here with bundles. For it to work there
> would need to be standard meanings to these bundles. I guess that would be
> the job of the OS to provide nice names and descriptions of useful
> collections of capabilities, right?
Bundles are really just themselves capabilities. A bundle is an object
with a published interface for retrieving each of the capabilities, e.g.:
class GameBundle(mixer: AudioMixer,
player: AudioPlayer,
keyboard: KeyboardInput,
joystick: JoystickInput,
screen: DisplayScreen) {
def bundle {
to getMixer { mixer }
to getPlayer { player }
to getKeyboard { keyboard }
to getJoystick { joystick }
to getScreen { screen }
}
}
In fact they aren't far off from the connect-the-boxes approach that
Miriam and i were envisioning in our GUI, if you extend the idea of
dialog boxes with slots for capabilities so that these bundles-of-slots
could be their own GUI objects.
So the OS could define these interfaces (i.e. the standard types such
as GameBundle) and the interfaces can be filled in with capabilities
to system components.
-- ?!ng