Browse thread
Re: [Caml-list] Type variables won't generalize
- Ryan Tarpine
[
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: | Re: [Caml-list] Type variables won't generalize |
>From: Remi VANICAT <vanicat@labri.u-bordeaux.fr> >To: caml-list@inria.fr >Subject: Re: [Caml-list] Type variables won't generalize >Date: 04 Apr 2002 14:04:16 +0200 > >... > >If you already know the types you can put in this field, you can use a >new variant type : > >type multi = >| Float of float >| Int of int >| Int2float of int -> float > >... > The problem is that I can't be sure of which types could be stored there. This record is meant to implement an object for an object-oriented language I'm trying to write. The problem field stores primitives like ints and floats for Integer and Float classes, but in the case that later on I would like to add new primitives like Num.num through extension modules (e.g., not by modifying and recompiling the entire language) a normal variant won't work. I unfortunately am having problems with typechecking when using polymorphic variants, so for now I am just going to use normal variants. Thanks, Ryan Tarpine, rtarpine@hotmail.com "To err is human, to compute divine. Trust your computer but not its programmer." - Morris Kingston Ryan Tarpine, rtarpine@hotmail.com "To err is human, to compute divine. Trust your computer but not its programmer." - Morris Kingston _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners