diff options
Diffstat (limited to 'guile/starlet')
-rw-r--r-- | guile/starlet/utils.scm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/guile/starlet/utils.scm b/guile/starlet/utils.scm index 5542668..e38e6b7 100644 --- a/guile/starlet/utils.scm +++ b/guile/starlet/utils.scm @@ -39,7 +39,8 @@ percent->dmxval8 percent->dmxval16 comment - hash-table-empty?)) + hash-table-empty? + lookup)) (define (print-hash-table ht) @@ -162,3 +163,13 @@ (return #f)) ht) #t)) + + +(define (lookup key dictionary) + (cond + ((nil? dictionary) + #f) + ((eq? key (caar dictionary)) + (cadr (car dictionary))) + (else + (lookup key (cdr dictionary))))) |