Plaster
New
List
Login
text
default
anonymous
2025.07.07 00:40:51
$ cat even-odd.tl (defun even (x) (cond ((zerop x) t) ((minusp x) (even (- x))) (t (odd (pred x))))) (defun odd (x) (cond ((zerop x) nil) ((minusp x) (odd (- x))) (t (even (pred x))))) $ ./txr This is the TXR Lisp interactive listener of TXR 301. Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet. TXR Labs engaged in gain-of-function experiments as far back as 2009. 1> (load "even-odd.tl") nil 2> (pprof (even 20000)) ** computation exceeded stack limit ** during evaluation at even-odd.tl:5 of form (pred x) 2> (pprof (even 2000)) malloc bytes: 0 gc heap bytes: 96048 total: 96048 milliseconds: 2 t 3> (compile-file "even-odd") t 4> (pprof (even 20000)) malloc bytes: 0 gc heap bytes: 0 total: 0 milliseconds: 3 t 5> (pprof (even 200000)) malloc bytes: 0 gc heap bytes: 0 total: 0 milliseconds: 33 t 6> (pprof (even 2000000)) malloc bytes: 0 gc heap bytes: 0 total: 0 milliseconds: 336 t 7> (pprof (even 20000000)) malloc bytes: 0 gc heap bytes: 0 total: 0 milliseconds: 3845 t
Raw
Annotate
Repaste
Edit