mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
Fixing bug in iset-map.
This commit is contained in:
parent
1eeed831a5
commit
184b2aaf9f
2 changed files with 4 additions and 1 deletions
|
@ -220,7 +220,7 @@
|
||||||
(apply iset-delete! (iset-copy iset) args))
|
(apply iset-delete! (iset-copy iset) args))
|
||||||
|
|
||||||
(define (iset-map proc iset)
|
(define (iset-map proc iset)
|
||||||
(iset-fold (lambda (i is) (iset-adjoin! is i)) (make-iset) iset))
|
(iset-fold (lambda (i is) (iset-adjoin! is (proc i))) (make-iset) iset))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; High-level set operations.
|
;; High-level set operations.
|
||||||
|
|
|
@ -94,4 +94,7 @@
|
||||||
(test-assert (iset-contains? (iset-union a b) 119))
|
(test-assert (iset-contains? (iset-union a b) 119))
|
||||||
(test-assert (iset-contains? (iset-union b a) 119)))
|
(test-assert (iset-contains? (iset-union b a) 119)))
|
||||||
|
|
||||||
|
(test '(2 3 4)
|
||||||
|
(iset->list (iset-map (lambda (i) (+ i 1)) (iset 1 2 3))))
|
||||||
|
|
||||||
(test-end)
|
(test-end)
|
||||||
|
|
Loading…
Add table
Reference in a new issue