Paste: This should make unboxing work

Author: littledan
Mode: factor
Date: Mon, 6 Apr 2009 01:07:54
Plain Text |
TUPLE: interval-set { array uint-array read-only } ;

<PRIVATE

ALIAS: start first
ALIAS: end second

: find-interval ( key interval-set -- slice )
    array>> 2 <sliced-groups>
    [ start <=> ] with search nip ; inline

PRIVATE>

: in? ( key set -- ? )
    dupd find-interval
    [ [ start ] [ end 1- ] bi between? ]
    [ drop f ] if* ;

New Annotation

Summary:
Author:
Mode:
Body: