/[guile]/guile/guile-core/doc/ref/scheme-options.texi
ViewVC logotype

Diff of /guile/guile-core/doc/ref/scheme-options.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by ossau, Sat Mar 16 00:27:25 2002 UTC revision 1.8 by ossau, Tue Jul 16 22:25:49 2002 UTC
# Line 251  breakpoints     no      *Check for break Line 251  breakpoints     no      *Check for break
251  cheap           yes     *Flyweight representation of the stack at traps.  cheap           yes     *Flyweight representation of the stack at traps.
252  @end smallexample  @end smallexample
253    
254    @subsection Stack overflow
255    
256    @cindex overflow, stack
257    @cindex stack overflow
258    Stack overflow errors are caused by a computation trying to use more
259    stack space than has been enabled by the @code{stack} option.  They are
260    reported like this:
261    
262    @lisp
263    (non-tail-recursive-factorial 500)
264    @print{}
265    ERROR: Stack overflow
266    ABORT: (stack-overflow)
267    @end lisp
268    
269    If you get an error like this, you can either try rewriting your code to
270    use less stack space, or increase the maximum stack size.  To increase
271    the maximum stack size, use @code{debug-set!}, for example:
272    
273    @lisp
274    (debug-set! stack 200000)
275    @result{}
276    (show-file-name #t stack 200000 debug backtrace depth 20 maxdepth 1000 frames 3 indent 10 width 79 procnames cheap)
277    
278    (non-tail-recursive-factorial 500)
279    @result{}
280    122013682599111006870123878542304692625357434@dots{}
281    @end lisp
282    
283    If you prefer to try rewriting your code, you may be able to save stack
284    space by making some of your procedures @dfn{tail recursive}.  For a
285    description of what this means, see @ref{Proper tail
286    recursion,,,r5rs,The Revised^5 Report on Scheme}.
287    
288    
289  @node Examples of option use  @node Examples of option use
290  @section Examples of option use  @section Examples of option use

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26