filtering lists in phoenix library. Phoenix 3.2.0

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

filtering lists in phoenix library. Phoenix 3.2.0

Luis Sánchez Sandoval
Hello All,

Phoenix 3.2.0 has a Lazy List included, one of the functions provided is filter, looking at the documentation I found that filter is only used with logical predicates even and odd, for example:

list<int> evens = filter(even, list_src);

assuming list_src is a list of ints.

how can I create a predicate to filter other type of values?, like: equal, or greater, etc.

for example: I want to filter all the ints that are 20

list<int> L20 = filter(equal(arg1, 20), list_src);  //does not work

Thank you very much for your help.


------------------------------------------------------------------------------

_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general