]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.units: utility word filter-word-defs
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 5 Dec 2016 07:55:32 +0000 (08:55 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Mon, 5 Dec 2016 07:55:32 +0000 (08:55 +0100)
requires new boot images

core/compiler/units/units.factor

index b90306a9cb46a5b2ec24f3b97036f9be7726df52..37f487d1a6d3127c6b2b34f3da559b0e1d0607c1 100644 (file)
@@ -67,12 +67,15 @@ HOOK: process-forgotten-words compiler-impl ( words -- )
 : compile ( words -- )
     recompile t f modify-code-heap ;
 
+: filter-word-defs ( defset -- words )
+    members [ word? ] filter ;
+
 ! Non-optimizing compiler
 M: f update-call-sites
     2drop { } ;
 
 M: f to-recompile
-    changed-definitions get members [ word? ] filter ;
+    changed-definitions get filter-word-defs ;
 
 M: f recompile
     [ dup def>> ] { } map>assoc ;
@@ -117,8 +120,7 @@ M: object always-bump-effect-counter? drop f ;
 <PRIVATE
 
 : changed-vocabs ( set -- vocabs )
-    members [ word? ] filter
-    [ vocabulary>> dup [ lookup-vocab ] when ] map ;
+    filter-word-defs [ vocabulary>> dup [ lookup-vocab ] when ] map ;
 
 : updated-definitions ( -- set )
     HS{ } clone