On Sat, Nov 5, 2011 at 11:21 AM, L N <[email protected]> wrote:

> Wondering if Factor has something similar.
>

For trivial things like rewriting 'swap swap', we let the compiler's
optimizer deal with those. It performs many of those optimizations. To
implement your own compile-time transforms, you can use Factor's MACRO:
words. They return a quotation which replaces the macro call at compile
time:

MACRO: or ( -- quot )
    [ [ t ] swap if ] ;

However, such things are rarely necessary since the compiler is good at
unraveling and optimizing higher-order functions already.

-Joe
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to