aboutsummaryrefslogtreecommitdiff
path: root/guile/starlet/utils.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guile/starlet/utils.scm')
-rw-r--r--guile/starlet/utils.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/guile/starlet/utils.scm b/guile/starlet/utils.scm
index 13ee585..be87321 100644
--- a/guile/starlet/utils.scm
+++ b/guile/starlet/utils.scm
@@ -1,6 +1,7 @@
(define-module (starlet utils)
#:export (return-unspecified
- print-hash-table))
+ print-hash-table
+ copy-hash-table))
(define (return-unspecified)
@@ -13,3 +14,10 @@
(display value)
(newline))
ht))
+
+(define (copy-hash-table ht)
+ (let ((new-ht (make-hash-table)))
+ (hash-for-each (lambda (key value)
+ (hash-set! new-ht key value))
+ ht)
+ new-ht))