Skip to content

Instantly share code, notes, and snippets.

@lokedhs
Created August 24, 2015 10:20
Show Gist options
  • Save lokedhs/cb5da5468aedbeef6452 to your computer and use it in GitHub Desktop.
Save lokedhs/cb5da5468aedbeef6452 to your computer and use it in GitHub Desktop.
(defclass rbt-empty-node (red-black-node)
())
(defmethod (setf rbt-color) (new-value (obj rbt-empty-node))
(error "Empty nodes can't be changed"))
(defmethod (setf left-child) (new-value (obj rbt-empty-node))
(error "Empty nodes can't be changed"))
(defmethod (setf right-child) (new-value (obj rbt-empty-node))
(error "Empty nodes can't be changed"))
(defmethod (setf parent) (new-value (obj rbt-empty-node))
(error "Empty nodes can't be changed"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment