]> gitweb.factorcode.org Git - factor.git/commitdiff
cfdg: Use 'specialized-arrays.double'
authorEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Wed, 3 Dec 2008 14:53:43 +0000 (08:53 -0600)
committerEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Wed, 3 Dec 2008 14:53:43 +0000 (08:53 -0600)
extra/cfdg/cfdg.factor

index 58772e23e0acf4bfeeaf2a48865ff4b6c4163118..e1c89374fd2cae73de6f188dd9ea41d6e3084ca9 100644 (file)
@@ -6,8 +6,10 @@ USING: kernel alien.c-types combinators namespaces make arrays
        vars colors self self.slots
        random-weighted colors.hsv cfdg.gl accessors
        ui.gadgets.handler ui.gestures assocs ui.gadgets macros
-       qualified speicalized-arrays.double ;
+       qualified specialized-arrays.double ;
+
 QUALIFIED: syntax
+
 IN: cfdg
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -53,7 +55,10 @@ VAR: color-stack
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: double-nth* ( c-array indices -- seq ) swap [ double-nth ] curry map ;
+! : double-nth* ( c-array indices -- seq ) swap [ double-nth ] curry map ;
+
+: double-nth* ( c-array indices -- seq )
+  swap byte-array>double-array [ nth ] curry map ;
 
 : check-size ( modelview -- num ) { 0 1 4 5 } double-nth* [ abs ] map biggest ;