Skip to content

Commit c7422a6

Browse files
committed
Fixes a defect in alist->hash-table
1 parent 5fb8d7c commit c7422a6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

rosetta-test/interpreter-tests.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,6 @@
115115
{"input": "(hash-table-walk ht (lambda (key value) key))", "expected": null},
116116
{"input": "(begin (hash-table-ref! ht 'c 3) (hash-table-ref ht 'c))", "expected": 3},
117117
{"input": "(hash-table->alist ht)", "expected": [["b", 2], ["c", 3]]},
118-
{"input": "(hash-table->alist (make-hash-table))", "expected": []}
118+
{"input": "(hash-table->alist (make-hash-table))", "expected": []},
119+
{"input": "(hash-table-ref (alist->hash-table '((a 10) (b 20))) 'b)", "expected": 20}
119120
]

rosetta-test/stdlib.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
(define ht (make-hash-table))
219219
(for-each
220220
(lambda (pair)
221-
(hash-table-set! ht (car pair) (cdr pair)))
221+
(hash-table-set! ht (car pair) (car (cdr pair))))
222222
alist)
223223
ht)
224224

0 commit comments

Comments
 (0)