 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays kernel math sequences strings sbufs ;
+USING: arrays kernel math sequences sequences.private strings
+sbufs ;
 IN: splitting
 
 <PRIVATE

PRIVATE>

: split-when ( ... seq quot: ( ... elt -- ... ? ) -- ... pieces )
    [ subseq ] (split) ; inline

: split-when-slice ( ... seq quot: ( ... elt -- ... ? ) -- ... pieces )
    [ <slice> ] (split) ; inline

: split ( seq separators -- pieces )
    [ member? ] curry split-when ; inline

    [ member? ] curry split-when-slice ; inline

: split-indices ( seq indices -- pieces )
    over length suffix 0 swap [
        [ pick subseq ] keep swap
    ] map 2nip ;

GENERIC: string-lines ( str -- seq )

