146147148149150151152153154155156
{ // attempt to match in order that matchers were added for (val current : cases) { val predicate = current.getFirst(); if (predicate.apply(input)) { val function = current.getSecond(); return function.apply(input); } }
149150151152153154155156157158159
{ val predicate = current.getFirst(); if (predicate.apply(input)) { val function = current.getSecond(); return function.apply(input); } } // use default matcher if (defaultFunc != null)