Faster make-class<cache
parent
5d78177abd
commit
6c4c36126a
|
@ -71,11 +71,13 @@ SYMBOL: class<cache
|
||||||
: class< ( cls1 cls2 -- ? )
|
: class< ( cls1 cls2 -- ? )
|
||||||
class<cache get [ hash hash-member? ] [ (class<) ] if* ;
|
class<cache get [ hash hash-member? ] [ (class<) ] if* ;
|
||||||
|
|
||||||
: smaller-classes ( class -- )
|
: smaller-classes ( class seq -- )
|
||||||
classes [ swap (class<) ] subset-with ;
|
[ swap (class<) ] subset-with ;
|
||||||
|
|
||||||
: make-class<cache ( -- hash )
|
: make-class<cache ( -- hash )
|
||||||
classes [ dup smaller-classes [ dup ] map>hash ] map>hash ;
|
classes dup [
|
||||||
|
2dup swap smaller-classes [ dup ] map>hash
|
||||||
|
] map>hash nip ;
|
||||||
|
|
||||||
: with-class<cache ( quot -- )
|
: with-class<cache ( quot -- )
|
||||||
[ make-class<cache class<cache set call ] with-scope ;
|
[ make-class<cache class<cache set call ] with-scope ;
|
||||||
|
|
Loading…
Reference in New Issue