sclass MatchableRecords {
new L records;
*() {}
*(A... records) { addAll(this.records, records); }
O fulfillVariable(IF1 makeRecord) {
new Var var;
O result = null;
A record = makeRecord.get(var);
O[] a = record._fieldsToList();
bigLoop: for (A r : records) {
if (r.getClass() != record.getClass()) continue;
O[] b = r._fieldsToList();
if (b.length != a.length) fail("Bad argument length: " + record);
for i over a:
if (a[i] == var) {
if (result != null && !eq(result, b[i]))
continue bigLoop;
result = b[i];
} else
if (!eq(a[i], b[i]))
continue bigLoop;
ret result;
}
null;
}
}