aboutsummaryrefslogtreecommitdiff
path: root/guile/starlet/utils.scm
blob: be87321c416b72d6d49363178050e5afc4a92b8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(define-module (starlet utils)
  #:export (return-unspecified
            print-hash-table
            copy-hash-table))


(define (return-unspecified)
  (if #f 1))

(define (print-hash-table ht)
  (hash-for-each (lambda (key value)
                   (display key)
                   (display " ---> ")
                   (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))