We don't have "list comprehensions", per se - but instead have basic map
and filter operations...

Instead of

    [ x for x in range(5) if x % 2 == 0 ]

We would have:

    5 iota [ 2 mod zero? ] filter

Instead of

    [ x ** 3 for x in foo() ]

We would have:

    foo [ 3 ^ ] map

You could use locals if you felt they helped:

    foo [| x | x 3 ^ ] map





On Mon, May 20, 2013 at 5:55 AM, graham telfer <gakouse...@hotmail.com>wrote:

> I was checking out the Rosetta Code site and noticed there is no example
> of list comprehension in Factor. How can we simulate this convenient tool?
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to