I'm almost done with the substitution variables, so I am now taking up the issue of data typing. Should I implement this feature?
If I do implement it, I will have the following data types:
Type used for range
Person Subject, DirObject, IndObject 0 - 15
Verb VerbData 0 - 971
Event HistoryBook 0 - ???
Object GiftData 0 - 127
Number Weight 0 - 0xFFFF
Furthermore, when the user selects an unspecified term and wishes to replace it with an operator, the software will do type checking and will mask out those operators that are not of the correct type. This is fine for the data operators and the function operators, which can have types associated with them, but what about the dyadic operators? Should they not yield only numbers? Does this not mean that we can never use such operators with any of the types other than numbers?
Perhaps I could solve this with a "void" data type that matches any other data type. We could also use some typecasting, but I think that's making things too complicated to foist on our users.
What bothers me about all this is the possibility that we could end up fighting the datatyping. I play fast and loose with such typing in many places. This is never a problem with Subject, Verb, and DirObject, but it can be a problem with IndObject and will surely be a problem with ThirdObject. That ThirdObject can take persons, verbs, events, objects, and numbers. I can't afford to break it out into five different objects; that would be entirely too wasteful.
Perhaps I could have some sort of locally defined type for ThirdObject. That is, the user can somehow declare that ThirdObject is a certain type for a certain verb. It defaults to a type "Number" but that typing can be modified by the user. This information would then be stored in the VerbData. Or perhaps it could be made part of the token string, but that strikes me as particularly inefficient.
I'm also a bit worried about such things as Plans. If we try to look up a plan, what kind of data type is that? There's also the general problem of unanticipated typing problems. What if my Pascal plays too fast and loose? Will I need to spend lots of time fighting my own typing? What happens when the user wants to ask, if (Who == Arthur)?