Created
August 1, 2013 20:09
-
-
Save PuercoPop/6134786 to your computer and use it in GitHub Desktop.
cd /Users/PuercoPop/quicklisp/local-projects/cl-pfds/src/
1 compiler notes: binary-tree.lisp:92:6: error: return for unknown block: :FIRST-CASE Compilation failed.
This file contains hidden or 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
(defmethod insert :around (element (node node)) | |
"Wrap the function call around a catch statement so to prevent unnecesary | |
copying when element already belongs in the tree. When run for the first time, | |
setup handler case of the element already present." | |
(cond ((not (boundp 'first-call)) | |
(block :first-case | |
(let ((first-call-result (let ((first-call t) | |
(result (call-next-method))) | |
(declare (ignore first-call)) | |
result))) | |
(if (eql first-call-result :non-local-exit) | |
node | |
first-call-result)))) | |
(t (let ((result (call-next-method))) | |
result)))) | |
(defmethod insert (element (node node)) | |
(cond | |
((ord-lt element (element node)) | |
(make-instance 'node | |
:left (insert element (left-branch node)) | |
:element (element node) | |
:right (right-branch node))) | |
((ord-gt element (element node)) | |
(make-instance 'node | |
:left (left-branch node) | |
:element (element node) | |
:right (insert element (right-branch node)))) | |
((ord-eql element (element node)) | |
(return-from :first-case :non-local-exit)) | |
(t node))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1 compiler notes:
binary-tree.lisp:92:6:
error: return for unknown block: :FIRST-CASE
Compilation failed.