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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject:
From: Juergen Pfitzenmaier <pfitzen@informatik.uni-tuebingen.de>

> when defining a lot of variants the following message seems to restrictive:
>    Too many constructors -- maximum is 248 constructors
> 
> What is the reason for this ? Can this limit be pushed higher ?

This is a hard-coded limit, so there is no magical compiler option to
raise it. There can be no more than 248 nonconstant constructors in a
variant type.

However, if your constructors are constant (they have no parameter),
then this is a now corrected bug. See PR#117 in the caml bug tracking
system.
With the corrected version of the compiler, you may use 2^31 constant
constructors independently of the 248 nonconstant ones.

As a temporary workaround you may use polymorphic variants: it should
be possible to use tens of thousands of both constant and nonconstant
constructors in the same type.

Jacques
---------------------------------------------------------------------------
Jacques Garrigue      Kyoto University     garrigue at kurims.kyoto-u.ac.jp
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>