math.functions: faster >rect by specializing for complex.

db4
John Benediktsson 2013-03-28 18:02:55 -07:00
parent 47fbfdf1f0
commit 71d37429ba
1 changed files with 5 additions and 2 deletions

View File

@ -61,8 +61,11 @@ M: complex ^n (^n) ;
PRIVATE> PRIVATE>
: >rect ( z -- x y ) GENERIC: >rect ( z -- x y )
[ real-part ] [ imaginary-part ] bi ; inline
M: real >rect 0 ; inline
M: complex >rect [ real-part ] [ imaginary-part ] bi ; inline
: >float-rect ( z -- x y ) : >float-rect ( z -- x y )
>rect [ >float ] bi@ ; inline >rect [ >float ] bi@ ; inline