Changeset 6207 in project for misc-extn


Ignore:
Timestamp:
09/30/07 06:48:26 (12 years ago)
Author:
Kon Lovett
Message:

Bug fix for [un]zip-alist

Location:
misc-extn
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • misc-extn/tags/3.003/misc-extn-list-support.scm

    r6206 r6207  
    205205          (error 'unzip-alist "improper assocication list" elm)) ) ) ) )
    206206
    207 (define zip-alist zip)
     207;;
     208
     209(define (zip-alist keys vals)
     210  (map cons keys vals) )
    208211
    209212;;; Deprecated
  • misc-extn/tags/3.003/tests/misc-extn-test.scm

    r6203 r6207  
    8686  )
    8787
    88   (expect-equal/values (values '(a b) '(1 2)) (unzip-alist '((a 1) (b 2))))
    89   (expect-equal '((a 1) (b 2)) (zip-alist '(a b) '(1 2)))
     88  (expect-equal/values (values '(a b) '((1) (2))) (unzip-alist '((a 1) (b 2))))
     89  (expect-equal '((a . 1) (b . 2)) (zip-alist '(a b) '(1 2)))
     90  (expect-equal '((a 1) (b 2)) (zip-alist '(a b) '((1) (2))))
    9091
    9192  (expect-equal '((a 1) (c 4) (b 5) (a 6) (d 7)) (alist-delete/count 'b alst1 eq? 2))
  • misc-extn/trunk/misc-extn-list-support.scm

    r6206 r6207  
    205205          (error 'unzip-alist "improper assocication list" elm)) ) ) ) )
    206206
    207 (define zip-alist zip)
     207;;
     208
     209(define (zip-alist keys vals)
     210  (map cons keys vals) )
    208211
    209212;;; Deprecated
  • misc-extn/trunk/tests/misc-extn-test.scm

    r6202 r6207  
    8686  )
    8787
    88   (expect-equal/values (values '(a b) '(1 2)) (unzip-alist '((a 1) (b 2))))
    89   (expect-equal '((a 1) (b 2)) (zip-alist '(a b) '(1 2)))
     88  (expect-equal/values (values '(a b) '((1) (2))) (unzip-alist '((a 1) (b 2))))
     89  (expect-equal '((a . 1) (b . 2)) (zip-alist '(a b) '(1 2)))
     90  (expect-equal '((a 1) (b 2)) (zip-alist '(a b) '((1) (2))))
    9091
    9192  (expect-equal '((a 1) (c 4) (b 5) (a 6) (d 7)) (alist-delete/count 'b alst1 eq? 2))
Note: See TracChangeset for help on using the changeset viewer.