Existential types, object-orientation.

Nick Kallen phantom@earthlink.net
Fri, 7 Nov 1997 14:50:46 -0800


Will you be able to use type classes with dynamic types? (the answer is
probably yes, but i'm just making sure).

I'd like to request this feature (related to dynamic types) that I think
would be useful. (I assume this is not already planned to be implemented):

There should be a way to specify a Dynamic type class like (in english):
"Dynamic class Drawable: A record with a field position, and a function
draw." The reason this is distinct from an existential type is that these
should be extendable. So some Dynamic type Sphere can be a member of the
Drawable class and can have --additional fields and functions-- like radius,
volume, render, etc. I'm getting very repetitive, but this would allow one
to write functions like a clipboard Copy function that could copy any
drawable, no matter what fields and functions it has, as long as it has the
base stuff that defines the class.
    Does this make any sense? And, does this sound like a good idea?

>2. Dynamic values are designed to persist beyond the borders of one
>   application. And, as different programs can define their own
>   datatypes (sometimes using the same name for different types),
>   is necessary to encode the entire definition of all datatypes.

Are they persistent? That is, will they exist in resident memory even when
all applications are closed (this can be -very- useful as the oo language
Oberon demonstrates)? Using the dynamic type classes outlined above, spiffy
things that Office does with OLE could be easily done: some dynamic class
Drawable would allow any -any- application to draw something of that type!
(E.g., a spreadsheet could be a member of drawable--so even a drawing
program can put a spreadsheet in an image!)