Slava,

: color ( iterations -- color )
    [ color-map [ length mod ] keep nth ] [ B{ 0 0 0 } ] if* ; inline

Is the length of 'color-map' being computed each time 'color' is called?

In versions of the code that I was experimenting with, I factored out the 
color selection part:

: color-map-size ( -- n ) color-map length ;

: lookup-color ( n -- color ) color-map-size mod color-map nth ;

: color ( iterations -- color ) [ lookup-color ] [ B{ 0 0 0 } ] if* ;

Ed

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to