Is there a way to evaluate an expression for each item of a list and collect the result into a list? The only method I have seen is to unroll the loop by hand, but this limits you to a fairly small number of items in the list, and is very cumbersome to write and change.
Making each MC expression function handle the list case would be cumbersome for the code writers and painful to QA. A clean (and simple) solution would be to provide a list iterator function looking like this:
ListForEach(List, expression)
where a new well-known fixed field name (e.g. [ListItem]) is usable inside the expression, just like [R1]..[R9] after a regex. You can of course make it fancier by adding input and output delimiters as in ListCombine.
Here is the exact problem I'm trying to solve. In classical music, artists play a specific instrument (or have a specific voice type) and, for operas, have a role. I'm trying to maintain a single field which contains a list of those triplets (something like {instrument}:{name}={role}; ...), and derive as computed fields in MediaCenter various combinations, such as {name}; ...; {name} for just the artists names, {instrument}\{name};... to lookup, say, all the pianists, or {role}\\{name}; ... to find all the singers which have played a specific role. This is pretty obvious to do with ListForEach and Regex.
Am I missing the obvious? If not, I think this would be a very nice addition to some future version of MC.