selecting from a list
I have a list - say for example [50 53 57 58].
I now have another list, composed of only zeros and ones, and of the exact same length as the list above. Say for example [1 0 1 1].
I'd like to generate a 3rd list, that represents only the elements of the 1st list, for which there is a corresponding "1" in the same position in the 2nd list. In our example, the resulting 3rd list would be [50 57 58].
Is there a clean, easy way to do this? I can brute force it using various zl objects, but thinking there must be some sexy way.... ;-)
you mean... with 3 or less objects? hmm...
with 2 objects!
But what should happen if the lists are [50 0 57 58] & [0 1 0 0] ? ;-)
this can probably be done in more efficient way

just a first thought I had
i have an abstraction for that which consists of 10 objects (including the IO)
it starts with vexpr like @LSKA above - but something like zl filter does not exist for my version of max, so changin the length is a pita. :)
also note that this type of solution wont work if there are zeros in the right list.
Thanks for all the replies!
@LSKA - your method is beautiful and works perfectly for my needs, as my first list will never have a zero in it. And even better, I'm embarrassed to say that in all my years of Max'ing I've never used or known of the vexpr object - it's exactly what I was thinking of in my head, "how can I multiply each element of the lists together?" - and boom, there it is. Thank you!