]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/interval-sets/interval-sets.factor
basis: use lint.vocabs tool to trim using lists
[factor.git] / basis / interval-sets / interval-sets.factor
index 32b671d212c577f75a151c2d5f33462549635a41..593ad17fd30ef64ae80270eccb3ba51207ce11e8 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2009 Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types arrays assocs binary-search
-combinators fry grouping kernel locals make math math.order
-sequences sequences.private sorting specialized-arrays ;
+classes combinators kernel make math math.order sequences
+sequences.private sorting specialized-arrays ;
 SPECIALIZED-ARRAY: uint
 IN: interval-sets
 ! Sets of positive integers
@@ -10,17 +10,8 @@ IN: interval-sets
 ! Intervals are a pair of { start end }
 TUPLE: interval-set { array uint-array read-only } ;
 
-<PRIVATE
-
-ERROR: not-an-interval-set obj ;
-
-: check-interval-set ( map -- map )
-    dup interval-set? [ not-an-interval-set ] unless ; inline
-
-PRIVATE>
-
-: in? ( key set -- ? )
-    check-interval-set array>>
+: interval-in? ( key set -- ? )
+    interval-set check-instance array>>
     dupd [ <=> ] with search swap [
         even? [ >= ] [ 1 - <= ] if
     ] [ 2drop f ] if* ;