Detect: element not in list?
I want to check if an element in not in a list, e.g. to provide a default response (route) if I'm about to hand a dict an unknown key. For example, I have a dict of reactions to colors with a key list that looks like this: [red green blue orange yellow]. And a section of the patch spits out a color label. What I want to generate is a default response "No idea on that one" when the key is not in the list of keys.
Newbe, here, but searches for such basic questions are very hard. I went through all the zl functions, and must have missed or misunderstood the one I needed. Or perhaps the answer is even more basic that that.
(Also, how do I add a patch to a message? )
zl.sub
Yes, thanks. Conceptual-blockbusting, I was thinking that I could input the list of known keys, once, when the dict was built and then test candidate key against that (previous) input. That is known keys on the right, candidate key on the left. Sigh. A long way to go.
Again, thanks.
"copy compressed" , paste to forum.
solution without zl:
vexpr comparison, followed by the inverse of the cross sum.

Thanks all! Most helpful. By the way, forcing myself to ramp up in Max by building a patch that uses a state machine to play the Westminster (clock) Chimes. Looks like it will be generalizable to play any set of "on the quarter" chimes. Fun and fascinating way to learn: take a problem and hack at it.