]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/isequences/ops/wipe/wipe.factor
61eef676367b19c08c6029efaade1570f1bd4d55
[factor.git] / unmaintained / isequences / ops / wipe / wipe.factor
1 ! Copyright (C) 2007 Robbert van Dalen.
2 ! See http://factorcode.org/license.txt for BSD license.
3
4 IN: isequences.ops.wipe
5 USING: generic kernel math sequences isequences.interface isequences.base ;
6
7
8 TUPLE: iwiped sequence ;
9
10 : <i-wiped> ( s -- iwiped ) 
11     dup i-length zero? [ drop 0 ] [ <iwiped> ] if ; inline
12
13 M: iwiped i-length iwiped-sequence i-length ;
14 M: iwiped i-at >r iwiped-sequence r> i-at right-side <i-right-sided> ;
15 M: iwiped ileft iwiped-sequence ileft <iwiped> ;
16 M: iwiped iright iwiped-sequence iright <iwiped> ;
17 M: iwiped ihead (ihead) ;
18 M: iwiped itail (itail) ;
19 M: iwiped $$ iwiped-sequence $$ dup quick-hash ;
20
21 M: object ## 
22     dup i-length 0 < [ -- <i-wiped> -- ] [ <i-wiped> ] if ;
23 M: integer ## ;
24 M: ineg ## -- ## -- ;
25 M: irev ## `` ## `` ;
26 M: iwiped ## ;