1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien alien.c-types classes.struct functors
4 kernel math quotations ;
5 IN: alien.complex.functor
7 <FUNCTOR: define-complex-type ( N T -- )
11 T-class DEFINES-CLASS ${T}
18 STRUCT: T-class { real N-type } { imaginary N-type } ;
21 >rect T-class boa >c-ptr ;
24 T-class memory>struct [ real>> ] [ imaginary>> ] bi rect> ; inline
27 <T> 1quotation >>unboxer-quot
28 *T 1quotation >>boxer-quot