diff --git a/fz/util.pl b/fz/util.pl index 2f8fffa..1f0e031 100644 --- a/fz/util.pl +++ b/fz/util.pl @@ -10,3 +10,11 @@ subset(S, [H|T], R) :- subset_aux(T, H, S, R). subset_aux(S, R, S, [R]). subset_aux([H|T], R1, S, [R1|R]) :- subset_aux(T, H, S, R). subset_aux([H|T], X, [X|S], R) :- subset_aux(T, H, S, R). + +% -- uniq_name(ROOT, NAME) ---------------------------------------------------- + +uniq_name(ROOT, NAME) :- + g_read(ROOT, N), + N1 is N+1, + format_to_atom(NAME, "~w_~w", [ROOT, N1]), + g_assign(ROOT, N1). -- libgit2 0.21.2