Find limit of recursion is part of Short Circuit's Console Program Basics selection.
Task

Find the limit of recursion.




(set-sig-handler sig-segv
  (lambda (signal async-p) (throw 'out)))
 
(defvar *count* 0)
 
(defun recurse ()
  (inc *count*)
  (recurse))
 
(catch (recurse)
  (out () (put-line `caught segfault!\nreached depth: @{*count*}`)))