// accepts a string as predicate (then compares with "eq") static int gSearchIdx(O predicate) { ret gSearchIdx(predicate, 0); } static int gSearchIdx(O predicate, int startIdx) { ret gSearchIdx(gLog(), predicate, startIdx); } static int gSearchIdx(L log, O predicate, int startIdx) { if (predicate == null) ret -1; if (predicate instanceof S) { final S _s = (S) predicate; predicate = func(S s) { eq(s, _s) }; } for (int i = l(log)-startIdx-1; i >= 0; i--) if (isTrue(callF(predicate, log.get(i)))) ret i; ret -1; }