static L<L<S>> gLearns() {
  ret gLearns(gLog());
}

// return latest learns first!
static L<L<S>> gLearns(L<S> log) {
  L<L<S>> parts = new L;
  for (int i = l(log)-1; i >= 0; i--) {
    S cmd = log.get(i);
    continue unless cmd.startsWith("!learn"); // fancy new "unless" syntax!
    new Matches mm;
    continue unless match("!learn *-*", log.get(i), mm);
    int m = mm.psi(0), n = mm.psi(1);
    //print("i=" + i +", m=" + m + ", n=" + n);
    L<S> part = subList(log, i-n, i-m+1);
    parts.add(part);
  }
  ret parts;
}