if (a in handful("struct", "class", "union"))

How is this different from

if(canFind(["struct", "class", "union"], a) {...}

It's a lot cleaner without the mess of brackets. You missed a ) on the second one, which, without intending snarkiness, perhaps demonstrates the greater elegance of the former? Though being able to use in on a simple array would be very nice.

if(a in ["struct", "class", "union"])

Wouldn't you expect to search an array at O(n) while an associative array would be O(1), making the difference not unintuitive?

Reply via email to