Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created August 1, 2013 20:09
Show Gist options
  • Save PuercoPop/6134786 to your computer and use it in GitHub Desktop.
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.
(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)))
@PuercoPop
Copy link
Author

1 compiler notes:

binary-tree.lisp:92:6:
error: return for unknown block: :FIRST-CASE

Compilation failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment