MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

[SERVER] Extended internal data types




Adding a new type currently involves adding a new entry in the var
type enumaration (registering it in a table), adding any new data
items in the Var structure, adding cases to several switch
statements, and creating a new database version.

It would be nice if it was possible to add new types in modules and
have all the modifications for a particular data type in one place.

In order for modules to add new types, operations that are currently
implemented with switch statements have to be changed to dispatch to
some code based on the type.

So one solution to this is to add a couple new fields to the existing
struct Var:
  a pointer to a table of functions to define what to do in
    various cases to deal with these types
  a pointer to some extended-type-specific data.

The database loading and saving code would need to be smarter about
types.

Comments?

--Ken



Home | Subject Index | Thread Index