aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-31 20:38:44 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-31 20:38:44 +0100
commit2f842e30775a1ad86cce7e30438cfe1dcc067fdc (patch)
treece9ee856e622cdc32d88113ed4c9093d4f3b98d5 /module
parentRepair warnings-are-error configuration item. (diff)
downloadcalp-2f842e30775a1ad86cce7e30438cfe1dcc067fdc.tar.gz
calp-2f842e30775a1ad86cce7e30438cfe1dcc067fdc.tar.xz
Add tree-node.
Diffstat (limited to 'module')
-rw-r--r--module/calp/html/view/calendar/shared.scm4
-rw-r--r--module/hnh/util/tree.scm4
2 files changed, 6 insertions, 2 deletions
diff --git a/module/calp/html/view/calendar/shared.scm b/module/calp/html/view/calendar/shared.scm
index de09e00a..11f1a70c 100644
--- a/module/calp/html/view/calendar/shared.scm
+++ b/module/calp/html/view/calendar/shared.scm
@@ -43,8 +43,8 @@
(unless (null? tree)
(let ((w (/ (- 1 x)
(+ 1 (length-of-longst-branch (left-subtree tree))))))
- (set! (width (car tree)) w
- (x-pos (car tree)) x)
+ (set! (width (tree-node tree)) w
+ (x-pos (tree-node tree)) x)
(inner (+ x w) (left-subtree tree))
(inner x (right-subtree tree))))))
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))