]> gitweb.factorcode.org Git - factor.git/commitdiff
core/basis/extras: use zip-with in a few places.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 20 Mar 2021 15:59:00 +0000 (08:59 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 20 Mar 2021 15:59:00 +0000 (08:59 -0700)
basis/help/help.factor
basis/ui/tools/browser/popups/popups.factor
core/compiler/units/units.factor
extra/ctags/ctags.factor
extra/lint/lint.factor
extra/reports/noise/noise.factor

index 29b3ffc9441e56402f35317b1e39246261851d9b..f33f0f52b112e9682021b3ac47cab7f86a6ca53f 100644 (file)
@@ -78,7 +78,7 @@ M: alias word-help*
     } 1|| ;
 
 : sort-articles ( seq -- newseq )
-    [ dup article-title ] { } map>assoc sort-values keys ;
+    [ article-title ] zip-with sort-values keys ;
 
 : all-errors ( -- seq )
     all-words [ error? ] filter sort-articles ;
index 8108448b739094573afaae986f67fea455ca04fa..f770d865e844e0abd84d17b6480c82827111b5b9 100644 (file)
@@ -20,8 +20,7 @@ TUPLE: links-popup < wrapper ;
 
 : <links-table> ( model quot -- table )
     '[
-        @ sort-articles
-        [ dup article-title ] { } map>assoc
+        @ sort-articles [ article-title ] zip-with
     ] <arrow> link-renderer [ second ] <search-table> dup table>>
         [ invoke-primary-operation ] >>action
         [ hide-glass ] >>hook
index b0662f8fa95d23bc5552be2e838eef25dbb3f1fe..9792bd525621b7a5c9295e07205d6de2f91bd1b4 100644 (file)
@@ -78,7 +78,7 @@ M: f to-recompile
     changed-definitions get filter-word-defs ;
 
 M: f recompile
-    [ dup def>> ] { } map>assoc ;
+    [ def>> ] zip-with ;
 
 M: f process-forgotten-words drop ;
 
index cc83aa13d81ef169b9087745dcdd80d2f157e5d3..bb1d2b76b255694db68aa834a36a972deb0451c4 100644 (file)
@@ -11,7 +11,7 @@ IN: ctags
 <PRIVATE
 
 : locations ( words -- alist )
-    [ dup where ] { } map>assoc sift-values ;
+    [ where ] zip-with sift-values ;
 
 : ctag ( word path lineno -- str )
     [
index a94fe1c08a77e172689c7db5aca4d40cb6c5ab38..6a4af697fc32277788c8ebf1d697da0d7e57833d 100644 (file)
@@ -283,7 +283,7 @@ GENERIC: run-lint ( obj -- obj )
     ] assoc-filter ;
 
 M: sequence run-lint ( seq -- seq )
-    [ dup lint ] { } map>assoc trim-self
+    [ lint ] zip-with trim-self
     [ second empty? ] reject filter-symbols ;
 
 M: word run-lint ( word -- seq ) 1array run-lint ;
index 3f4090c118a755d6aebf1bb202683c376f0c227b..c6a735564f92a68d688d9032d9a021a4e938d5c8 100644 (file)
@@ -120,7 +120,7 @@ M: lambda-word word-noise-factor
 
 : noisy-words ( -- alist )
     all-words flatten-generics
-    [ dup word-noise-factor ] { } map>assoc
+    [ word-noise-factor ] zip-with
     sort-values reverse ;
 
 : noise. ( alist -- )
@@ -140,7 +140,7 @@ M: lambda-word word-noise-factor
     ] if-empty ;
 
 : noisy-vocabs ( -- alist )
-    loaded-vocab-names [ dup vocab-noise-factor ] { } map>assoc
+    loaded-vocab-names [ vocab-noise-factor ] zip-with
     sort-values reverse ;
 
 : noise-report ( -- )