Skip to content

Instantly share code, notes, and snippets.

@dpk
Created October 3, 2012 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpk/3828768 to your computer and use it in GitHub Desktop.
Save dpk/3828768 to your computer and use it in GitHub Desktop.
don't use more than 100,000 cons pairs
; <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