; hash1.scm -
; build a hash table from an association list (of pairs)
(define (put-pairs! table pairs)
(for-each (lambda (x) (hash-table-put! table (car x) (cadr x) ))
pairs))
; build a simple hash table
(define myhash (make-hash-table))
(define pairs '((a 1) (b 2) (c 3) (d 4) (e 5)))
(put-pairs! myhash pairs)
; print out the whole hash table
(hash-table-for-each myhash (lambda (key value) (display (format "~%~A:~A" key value))))
Text file Source (historic): geocities.com/soho/square/3472
geocities.com/soho/squaregeocities.com/soho
(to report bad content: archivehelp @ gmail)
|
|
|
|
|