[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Ryan Tarpine <rtarpine@h...> |
| Subject: | [Caml-list] Allowing many types |
Recently, I've been playing with writing my own language. With some good books, and inspiration from existing languages, it's not that hard, really, even for a beginner :) The only problem I've found is setting the possible data types, the so-called "primitives" of the language. Currently, I have something like this: type Primitive = | PInt of int | PString of string | PFloat of float ... The problem is, I know that I will need new types in the future besides these. It's an object-oriented language, and I would like to add classes that manage things like Tk. Every object has a variable of type Primitive that it stores its value in. Is it possible to somehow allow other types, like Tk's widgets, without changing the definition of Primitive to include them and recompiling everything? Thanks in advance, Ryan Tarpine, rtarpine@hotmail.com "To err is human, to compute divine. Trust your computer but not its programmer." - Morris Kingston _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr