views:

56

answers:

2

Hi,

I'm relatively new to Lisp (I just know the very basics) and I'm currently trying to run an algorithmic composition program created by David Cope. It runs in MCL 5.0, and I keep getting the following error:

Error in process play: Stack overflow on value stack. To globally increase stack space, increase *minimum-stack-overflow-size*

Does anyone know what function I would use to increase the stack overflow size and how I would calculate the best stack overflow size for my computer? I'm running MCL on an old Powerbook with 512 MB of RAM.

Thanks for your time,

Eddie

A: 

It seems to say that you simply need to modify the special variable *minimum-stack-overflow-size*. When you are at the REPL (CL-USER> prompt or similar), inspect this variable by evaluating its name:

CL-USER> *minimum-stack-overflow-size*

Then, set it to a bigger value (the 1234567 is just a placeholder) with setf:

CL-USER> (setf *minimum-stack-overflow-size* 1234567)

However, this might not be the real issue. I do not know MCL well, but it might be necessary to (declaim (optimize (speed 3) (safety 0))) or similar to enable tail call elimination, if the program you want to run uses a tail recursive function which depends on such optimization.

Svante
+1  A: 

Originally memory options were edited with ResEdit.

One can also use the SAVE-APPLICATION function and use the :MEMORY-OPTIONS keyword to specify various values. This is described in the MCL reference manual. This function saves a new MCL application. Typically one starts vanilla MCL, sets various options, loads some libraries and then saves a new application. This new application is then used during development.

The necessary stack size depends on the program you want to run.

If a stack overflow happens, in MCL you can continue with a larger stack in many cases. Just choose the right restart option.

Rainer Joswig