Created
October 3, 2012 18:21
-
-
Save dpk/3828768 to your computer and use it in GitHub Desktop.
don't use more than 100,000 cons pairs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; <sbp> this is why lisp engineers aren't allowed to pilot submarines | |
(setq *all-conses* (make-array 100000)) | |
(dotimes (ii 100000) (setf (aref *all-conses* ii) (cons nil nil))) | |
(setq *conses-index* 0) | |
(defun cons (hd tl) | |
(let ((the-cons (aref *all-conses* *conses-index*))) | |
(setq *conses-index* (1+ *conses-index*)) | |
(setf (car the-cons) hd) | |
(setf (cdr the-cons) tl) | |
the-cons)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment