lol, so scala has a built in isOneOf, of course it wins there...this
is of course a non-example. im not sure why some of our code is so
bloated, its been there for years. i cleaned this one up to, here is
the "concise" version:

private boolean isOneOf(final char ch, final char[] charray) {
    for (char c : charray) if (c==ch) return true;
    return false;
}
what does the scala code for exists() look like? :)

Good re-write.
The Scala exists code pretty much looks like a generic version
of the isOneOf code.
The FP folks would point out that the difference is that there
are a bunch of such canned methods on all collection objects
and they are designed to be chained together.

--
Quis custodiet ipsos custodes

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to