Lisp refactoring puzzle

WJ w_a_x_man at yahoo.com
Tue Jul 12 17:27:27 CEST 2011


Xah Lee wrote:

> it's funny, in all these supposedly modern high-level langs, they
> don't provide even simple list manipulation functions such as union,
> intersection, and the like. Not in perl, not in python, not in lisps.

Ruby has them.

Intersection:

[2,3,5,8] & [0,2,4,6,8]
    ==>[2, 8]

Union:

[2,3,5,8] | [0,2,4,6,8]
    ==>[2, 3, 5, 8, 0, 4, 6]



More information about the Python-list mailing list