Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;; with default optimizations
- (defun factorial (n)
- (cond ((= n 0) 1)
- (t (* n (factorial (- n 1))))))
- ;;; poor, c conversion, :)
- #+:clisp
- (format t "~S~&" (factorial 6000))
- ;;; better, :)
- #+:ecl
- (format t "~S~&" (factorial 12000))
- ;;; this is already optimized by default
- #+:cmu
- (format t "~S~&" (factorial 100000))
- ;;; the numbers are random, that means i didn't try to find a limit,
- ;;; just stop before 'stack overflow' for clisp and ecl, first hit
- ;;; from cmucl
- ;;;
- ;;; usage, just (load "fact.lisp") in the interpretor.
- ;;;
Add Comment
Please, Sign In to add comment