1 ! Copyright (C) 2005, 2008 Slava Pestov, Daniel Ehrenberg.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: sequences kernel accessors ;
7 TUPLE: column seq col ;
11 M: column virtual-seq seq>> ;
12 M: column virtual@ [ col>> swap ] [ seq>> ] bi nth bounds-check ;
13 M: column length seq>> length ;
15 INSTANCE: column virtual-sequence
17 : <flipped> ( seq -- seq' )
18 dup empty? [ dup first length [ <column> ] with map ] unless ;