Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defstruct (tree-methods)
- empty-p leaf-p label children
- make-empty make-leaf make-tree)
- (defparameter *labelless-nary-tree*
- (make-tree-methods
- :empty-p (function null)
- :leaf-p (function atom)
- :label (constantly nil)
- :children (lambda (node) node)
- :make-empty (constantly nil)
- :make-leaf (function identity)
- :make-tree (lambda (label children)
- (declare (ignore label))
- children)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement