diff options
Diffstat (limited to 'module/hnh/util')
-rw-r--r-- | module/hnh/util/table.scm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/module/hnh/util/table.scm b/module/hnh/util/table.scm index 268f1081..8955f70f 100644 --- a/module/hnh/util/table.scm +++ b/module/hnh/util/table.scm @@ -49,9 +49,8 @@ (modify tree (if (symbol<? k (key tree)) left right) tree-put k v)))) -(define (tree-get tree k) - (cond ((tree-terminal? tree) #f ; (throw 'out-of-range) - ) +(define* (tree-get tree k optional: default) + (cond ((tree-terminal? tree) default) ((eq? k (key tree)) (value tree)) ((symbol<? k (key tree)) (tree-get (left tree) k)) |