On Sunday 31 December 2006 20:38, Grant Olson wrote:
> > You are trying to store heterogeneously typed values in a language that
> > only supports homogeneous types. There are various ways around this.
> > The simplest is to support only one type and add a type annotation:
> >
> > let textures : (string, ([ `rgb ], [ `ubyte ]) GlPix.t) Hashtbl.t =
> > Hashtbl.create 100;;
>
> Thanks, that worked. But just to clarify, is it heterogeneous because the
> value types normally need to match the key types? I thought it was
> homogeneous because all of the keys were strings, and all of the values
> were textures.
"Textures" is a set of types in this case.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists
.