// if match: returns -1 // if no match: returns how many conditions were met static int matchConditions_random(L conditions, Map m) { if (empty(conditions)) ret -1; Lisp condition = first(conditions); Map m2 = cloneMap(m); if (!matchCondition_random(condition, m2)) { print("Condition failed: " + condition); ret 0; } print("Condition matched, " + struct(m2)); int n = matchConditions_random(dropFirst(conditions), m2); if (n == -1) { m.putAll(m2); ret -1; } ret n+1; // failure }