Mercurial > core / lisp/lib/obj/tree/node.lisp
changeset 698: |
96958d3eb5b0 |
parent: |
d7aa08025537
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 ;;; lib/obj/tree/node.lisp --- Tree Nodes 3 ;; SBCL provides excellent support for the ANSI CL built-in types such 4 ;; as vector/array, list, hash-table. We don't need to provide much in 5 ;; terms of additional support for these. There are some internal SBCL 6 ;; collections such as RBTREE, AVLTREE and BROTHERTREE which we expose here 7 ;; and provide additional support for. 10 (in-package :obj/tree) 12 (deftype keytype () 'sb-vm:word) 14 (defstruct (tree-node (:copier nil) 15 (:constructor make-node (key))) 16 (key 0 :type keytype)) 18 (defstruct (unary-node (:include tree-node)) 21 (defstruct (binary-node (:include tree-node) 23 (:constructor make-binary-node (key left right))) 26 ;; temporary nodes eliminated when a tree is compiled 27 (defstruct (ternary-node (:include binary-node) 29 (:constructor make-ternary-node (left key1 middle key2 right))) 32 (defstruct (avl-node (:include tree-node) 34 (:constructor make-avl-node (key data left right)))