Browse Source

Tell ASDF to block compile the source file on SBCL, due to mutually-recursive structure definitions.

main
Michael Fiano 2 months ago
parent
commit
d5ac6ebaba
Signed by: mfiano
GPG Key ID: F87DF4666D70FC63
  1. 3
      red-black-tree.asd
  2. 26
      src/red-black-tree.lisp

3
red-black-tree.asd

@ -11,4 +11,5 @@
:serial t
:components
((:file "package")
(:file "red-black-tree")))
(:file "red-black-tree"
:around-compile (lambda (x) (funcall x #+sbcl :block-compile #+sbcl t)))))

26
src/red-black-tree.lisp

@ -1,5 +1,18 @@
(in-package #:red-black-tree)
(defstruct (tree
(:constructor %make-tree)
(:conc-name nil)
(:predicate nil)
(:copier nil))
(sentinel nil :type (or node null))
(root nil :type (or node null))
(key-func #'identity :type function)
(sort-func #'< :type function))
(u:define-printer (tree stream :type nil)
(format stream "TREE"))
(declaim (inline %make-node))
(defstruct (node
(:constructor %make-node)
@ -17,19 +30,6 @@
(u:define-printer (node stream :type nil)
(format stream "NODE"))
(defstruct (tree
(:constructor %make-tree)
(:conc-name nil)
(:predicate nil)
(:copier nil))
(sentinel nil :type (or node null))
(root nil :type (or node null))
(key-func #'identity :type function)
(sort-func #'< :type function))
(u:define-printer (tree stream :type nil)
(format stream "TREE"))
(u:fn-> make-node (tree t) node)
(defun make-node (tree item)
(declare (optimize speed))

Loading…
Cancel
Save