Search code examples
listqore

How to test whether an element exists in list?


Is there a way how to test whether an element exists in list?

$ qore -nX 'boolean(select ("a", "b", "c"), $1 === "a")'

This solution creates a new list only to test its size...


Solution

  • There is actually a language function for this! inlist and inlist_hard