// returns list(pair(id, rule)) static L mL_rules_addGlobalIDsIfAuthed(S listName) { L l = splitAtEmptyLines(mL_raw(listName)); L withIDs = combineWithGlobalIDs(l); bool change = false; for (PairS p : withIDs) { if (empty(p.a)) p.a = aGlobalID(); change = true; } if (change && isMechAuthed()) { newText = joinWithEmptyLines(map(l, func(PairS p) { prependGlobalIDInNewLineAndIndent(p.a, p.b) })); editMechList("NL Logic Rules w/IDs", newText); } ret l; }