fix alien.complex unboxer
parent
762a8c32cb
commit
be406fa964
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors alien.structs alien.c-types classes.struct math
|
USING: accessors alien alien.structs alien.c-types classes.struct math
|
||||||
math.functions sequences arrays kernel functors vocabs.parser
|
math.functions sequences arrays kernel functors vocabs.parser
|
||||||
namespaces quotations ;
|
namespaces quotations ;
|
||||||
IN: alien.complex.functor
|
IN: alien.complex.functor
|
||||||
|
@ -17,7 +17,7 @@ WHERE
|
||||||
STRUCT: T-class { real N } { imaginary N } ;
|
STRUCT: T-class { real N } { imaginary N } ;
|
||||||
|
|
||||||
: <T> ( z -- alien )
|
: <T> ( z -- alien )
|
||||||
>rect T-class <struct-boa> ;
|
>rect T-class <struct-boa> >c-ptr ;
|
||||||
|
|
||||||
: *T ( alien -- z )
|
: *T ( alien -- z )
|
||||||
T-class memory>struct [ real>> ] [ imaginary>> ] bi rect> ; inline
|
T-class memory>struct [ real>> ] [ imaginary>> ] bi rect> ; inline
|
||||||
|
|
|
@ -110,6 +110,8 @@ M: struct-class reader-quot
|
||||||
M: struct-class writer-quot
|
M: struct-class writer-quot
|
||||||
nip (writer-quot) ;
|
nip (writer-quot) ;
|
||||||
|
|
||||||
|
! c-types
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
: struct-slot-values-quot ( class -- quot )
|
: struct-slot-values-quot ( class -- quot )
|
||||||
struct-slots
|
struct-slots
|
||||||
|
|
Loading…
Reference in New Issue