]> gitweb.factorcode.org Git - factor.git/blob - basis/specialized-vectors/functor/functor.factor
change math.floats.env tests not to use any libm functions, which don't reliably...
[factor.git] / basis / specialized-vectors / functor / functor.factor
1 ! Copyright (C) 2008, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien.c-types functors sequences sequences.private growable
4 prettyprint.custom kernel words classes math parser ;
5 QUALIFIED: vectors.functor
6 IN: specialized-vectors.functor
7
8 FUNCTOR: define-vector ( T -- )
9
10 V   DEFINES-CLASS ${T}-vector
11
12 A   IS      ${T}-array
13 S   IS      ${T}-sequence
14 <A> IS      <${A}>
15
16 >V  DEFERS >${V}
17 V{  DEFINES ${V}{
18
19 WHERE
20
21 V A <A> vectors.functor:define-vector
22
23 M: V contract 2drop ;
24
25 M: V byte-length underlying>> byte-length ;
26
27 M: V pprint-delims drop \ V{ \ } ;
28
29 M: V >pprint-sequence ;
30
31 M: V pprint* pprint-object ;
32
33 SYNTAX: V{ \ } [ >V ] parse-literal ;
34
35 INSTANCE: V growable
36 INSTANCE: V S
37
38 ;FUNCTOR