[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
opaque type proposal
OK, I think I buy your arguments for single inheritance. So how about
this: MAKE-RECORD-TYPE takes as an additional argument a descriptor for
the parent type, or #f if there is to be none.
About the identification argument to MAKE-RECORD-TYPE, the reason I
suggested it be a symbol was just to avoid overspecification: objects of
other types could mean different things. E.g. at some point that
argument could (upward-compatibly) become some kind of handler procedure
for the record type.
The identification argument should probably be optional, or perhaps not
exist at all. I don't know.
By the way, the object returned by MAKE-RECORD-TYPE ought to be called a
"record type descriptor", or anything other than "record type". Calling
any object a "type" would be a bad precedent and would frustrate the
efforts of those using Scheme for teaching and designing statically
typed languages.
I would oppose anything resembling TYPE-OF, since whenever you have
subtyping or polymorphism, there's no such thing as THE type of an
object. I don't see why it would be useful either, since you can always
put type-specific information (like generic operation handlers)
somewhere else; e.g. in the case of records, you can put it in the type
descriptor.