"InSet!(var, values...)."

That wouldn't work because var is known only at runtime. Ideally I'd
like to write something like:

string needle = "foo";
if (needle.InSet!("bar", "barfoo", "doo", "foo")) { }

And InSet would mixin and call a function such as:
bool inSet(string needle)
{
    if (needle = "bar" || needle = "barfoo" || needle == "doo"
        || needle == "foo") return true;
    return false;
}

However I don't think this is possible. I want the string literals to
be binded at compile time, and needle to be binded at runtime with the
UFC syntax. However in this case the compiler tries to pass needle as
a compile-time argument, which fails.

Reply via email to