Version française
Home     About     Download     Resources     Contact us    
Browse thread
Stack_overflow
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Till Varoquaux <till.varoquaux@g...>
Subject: Re: [Caml-list] Re: Stack_overflow
On 4/1/06, mulhern <mulhern@gmail.com> wrote:
>
> Thanks to everybody who responded.
>
> To clarify things:
> I'm trying to _compile_ a list definition.
> So, my .ml file looks like this:
>
> ---
> let myList = [("first", ["some"; more]);
>                    ("second", ["more"; "still"])]
> ---
> except that there are 12,000 elements in the list instead of two as in
> the example.
> _ocamlc_ throws a Stack_overflow error while compiling this list. So,
> I want to know how to influence _ocamlc_ to be able to compile this or
> larger lists.
>
> The suggestion of chunkifying the list into smaller lists is a
> practical one; I may be forced to try it.
>
> ocamlc.opt compiles the list fine but that reduces portability.
>
> -mulhern


Note that ocamlc.opt should produce exactly the same code than ocamlc....
The difference is that the compiler is natively compiled instead of
byte-compiled. Therefor your program will run in as many places it just
won't compile on plateforms without ocamlc.opt. You could put your list in a
separate module, byte compile it and "include" it in the reste of your
source. This *should* solve the problem (I might be wrong) and you could
still bundle the rest of your sources in a way that would allow to compile
them with ocamlc.


Till