This already exists in Python in the form of comprehensions
sum(x * x for x in [1,2,3,4,5] if x % 3 == 1)
I'm not familiar with Lucid but maybe evaluating the implementation of comprehensions could help solve some of the design challenges.