[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tail recursion, again



Hi Larry,

; Our code simply will not run on the Symbolics without blowing the
; stack. As a result, my 3645 is nothing but an expensive terminal to a Sun.

  I am catching up on a few days worth of mail so if this is redundant
  please excuse me. The Symbolics drops into the debugger during recur-
  sive function calls. First thought: What a wimpy machine. But in the
  event that it saves your environment (like when someone modifies the
  code to do a recursive nose dive) the meaning for it seems clear. A
  Sun would just cons until it drops.

  In short, the debugger is only trying to help you. Now, what to do if
  you do not desire the debugger's help: Catch the offending form and
  prevent it from running you into the debugger. The following code will
  help you do this...

  (block nil
    (sys:condition-bind
      ((SYS:PDL-OVERFLOW
	 (lambda (err)
	   ; (format *standard-output* "~%Growing the stack...")
	   (sys:proceed err :grow-pdl))))
      (recursive-function)))

(Rod Swab | NASA Ames Research Center | swab@pluto.arc.nasa.gov)