diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-01-31 20:38:44 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-01-31 20:38:44 +0100 |
commit | 2f842e30775a1ad86cce7e30438cfe1dcc067fdc (patch) | |
tree | ce9ee856e622cdc32d88113ed4c9093d4f3b98d5 /module/hnh | |
parent | Repair warnings-are-error configuration item. (diff) | |
download | calp-2f842e30775a1ad86cce7e30438cfe1dcc067fdc.tar.gz calp-2f842e30775a1ad86cce7e30438cfe1dcc067fdc.tar.xz |
Add tree-node.
Diffstat (limited to 'module/hnh')
-rw-r--r-- | module/hnh/util/tree.scm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/module/hnh/util/tree.scm b/module/hnh/util/tree.scm index 6c4f765d..95328b5f 100644 --- a/module/hnh/util/tree.scm +++ b/module/hnh/util/tree.scm @@ -3,6 +3,7 @@ #:use-module (hnh util) #:export (make-tree left-subtree right-subtree + tree-node length-of-longst-branch tree-map)) @@ -18,6 +19,9 @@ (make-tree pred? head) (make-tree pred? tail))))) +(define (tree-node tree) + (car tree)) + (define (left-subtree tree) (list-ref tree 1)) |