2009-07-07 15:34:08 -04:00
|
|
|
! Copyright (C) 2008, 2009 Slava Pestov.
|
2008-11-14 21:18:16 -05:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
|
USING: functors sequences sequences.private growable
|
2008-12-08 15:58:00 -05:00
|
|
|
prettyprint.custom kernel words classes math parser ;
|
2009-07-07 15:34:08 -04:00
|
|
|
QUALIFIED: vectors.functor
|
2008-11-14 21:18:16 -05:00
|
|
|
IN: specialized-vectors.functor
|
|
|
|
|
|
|
|
|
|
FUNCTOR: define-vector ( T -- )
|
|
|
|
|
|
2009-07-07 15:34:08 -04:00
|
|
|
V DEFINES-CLASS ${T}-vector
|
|
|
|
|
|
2008-11-14 21:18:16 -05:00
|
|
|
A IS ${T}-array
|
2008-12-03 01:05:32 -05:00
|
|
|
<A> IS <${A}>
|
2008-11-14 21:18:16 -05:00
|
|
|
|
2009-07-07 15:34:08 -04:00
|
|
|
>V DEFERS >${V}
|
2008-11-14 21:18:16 -05:00
|
|
|
V{ DEFINES ${V}{
|
|
|
|
|
|
|
|
|
|
WHERE
|
|
|
|
|
|
2009-07-07 15:34:08 -04:00
|
|
|
V A <A> vectors.functor:define-vector
|
2008-11-14 21:18:16 -05:00
|
|
|
|
2009-07-07 16:01:30 -04:00
|
|
|
M: V contract 2drop ;
|
|
|
|
|
|
2009-01-28 19:48:07 -05:00
|
|
|
M: V pprint-delims drop \ V{ \ } ;
|
2008-11-14 21:18:16 -05:00
|
|
|
|
|
|
|
|
M: V >pprint-sequence ;
|
|
|
|
|
|
|
|
|
|
M: V pprint* pprint-object ;
|
|
|
|
|
|
2009-03-21 02:27:50 -04:00
|
|
|
SYNTAX: V{ \ } [ >V ] parse-literal ;
|
2008-11-14 21:18:16 -05:00
|
|
|
|
|
|
|
|
INSTANCE: V growable
|
|
|
|
|
|
|
|
|
|
;FUNCTOR
|