List Info

Thread: "ocaml_beginners"::[] The type of this expression ... contains type variable




"ocaml_beginners"::[] The type of this expression ... contains type variable
user name
2006-12-07 21:48:18

Yes I'm sure it's necessary. If, say, the hashtbl is only used from
another module, it can't infer the type.

Also, that's the toplevel, not compiling a file with ocamlc/ocamlopt.

Jonathan

On 12/8/06, jshaw10 < jshaw10%40yahoo.com">jshaw10yahoo.com> wrote:
&gt; Are you sure that's necessary? This works fine:
>;
>
&gt; Objective Caml version 3.08.3
&gt;
> # let hash = Hashtbl.create 500;;
>; val hash : ('_a, '_b) Hashtbl.t = <abstr&gt;
> #
>
&gt;
> Caml will will infer '_a and _'b later when you do Hashtbl.add hash
> for instance.
>
>
>
>; Archives up to November 11, 2006 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
> The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
> Attachments are banned and you're asked to be polite, avoid flames etc.
> Yahoo! Groups Links
>;
>
&gt;
>

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] The type of this expression ... contains type variable
user name
2006-12-07 21:59:05

I believe the error pops up at the end of the type inference process
for the given compilation unit (.ml file). This never happens in the
toplevel.

Martin

On Fri, 8 Dec 2006, Jonathan Roewen wrote:

> Yes I'm sure it's necessary. If, say, the hashtbl is only used from
> another module, it can't infer the type.
>;
> Also, that's the toplevel, not compiling a file with ocamlc/ocamlopt.
>;
> Jonathan
>
> On 12/8/06, jshaw10 < jshaw10%40yahoo.com">jshaw10yahoo.com> wrote:
&gt; > Are you sure that's necessary? This works fine:
>; >
> >
> > Objective Caml version 3.08.3
&gt; >
> > # let hash = Hashtbl.create 500;;
>; > val hash : ('_a, '_b) Hashtbl.t = <abstr&gt;
> > #
> >
> >
> > Caml will will infer '_a and _'b later when you do Hashtbl.add hash
> > for instance.
> >
> >
> >
> > Archives up to November 11, 2006 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
> > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
> > Attachments are banned and you're asked to be polite, avoid flames etc.
> > Yahoo! Groups Links
>; >
> >
> >
> >
>
>
>; Archives up to November 11, 2006 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
> The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
> Attachments are banned and you're asked to be polite, avoid flames etc.
> Yahoo! Groups Links
>;
>
&gt;
>

--
Martin Jambon, PhD
http://martin.jambon.free.fr

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] The type of this expression ... contains type variable
user name
2006-12-07 22:12:34

Jonathan Roewen wrote:
&gt; Yes I'm sure it's necessary. If, say, the hashtbl is only used from
> another module, it can't infer the type.
>;
> Also, that's the toplevel, not compiling a file with ocamlc/ocamlopt.
>;
> Jonathan
>
You are right, the error appeared when I moved the creation of the table
in an other module.
François Colonna

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )