[mercury-users] Limitations of discriminated unions.

Bartlomiej Szymczak rhywek at gmail.com
Tue Jul 10 22:46:08 AEST 2007


Hi.

I've made a file, which contains the following:

:-module test.
:-interface.
:-import_module io.
:-pred main(io::di,io::uo) is det.
:-type t --->
t_1;
t_2;
...
t_500000.
:-implementation.
main(!IO).

So main does nothing. Actually there's more than 500000 constructors.
The file has 11MB. When I try to compile it I get the following error:

$ mmc -m test

Mercury runtime: memory zone detstack#0 overflowed
PC at signal: 140012869 (8586d45)
This may have been caused by a stack overflow, due to unbounded recursion.

Can't I have enumeration like that with half a million elements?

Maybe someone knows how to make it work (increase compiler's stack size, etc)?

Best regards,
-- 
Bartlomiej Antoni Szymczak

Gmail: rhywek at gmail.com
Work mail: bas at imm.dtu.dk
DTU office: 321/129
DTU tel.: +4545253892
Mobile: +4520789323
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list