assocs: 50% faster zip.

db4
John Benediktsson 2012-04-25 20:09:21 -07:00
parent 40e79d4b56
commit 664908c78f
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@ M: assoc value-at* swap [ = nip ] curry assoc-find nip ;
[ ?push ] change-at ; [ ?push ] change-at ;
: zip ( keys values -- alist ) : zip ( keys values -- alist )
2array flip ; inline [ 2array ] { } 2map-as ; inline
: unzip ( assoc -- keys values ) : unzip ( assoc -- keys values )
dup assoc-empty? [ drop { } { } ] [ >alist flip first2 ] if ; dup assoc-empty? [ drop { } { } ] [ >alist flip first2 ] if ;