src/Pure/term.ML
changeset 12902 a23dc0b7566f
parent 12802 c69bd9754473
child 12981 f48de47c32d6
equal deleted inserted replaced
12901:4570584fbda9 12902:a23dc0b7566f
   736   First attaches the suffix "a" and then increments this;
   736   First attaches the suffix "a" and then increments this;
   737   preserves a suffix of underscores "_". *)
   737   preserves a suffix of underscores "_". *)
   738 fun variant bs name =
   738 fun variant bs name =
   739   let
   739   let
   740     val (c, u) = pairself implode (Library.take_suffix (equal "_") (Symbol.explode name));
   740     val (c, u) = pairself implode (Library.take_suffix (equal "_") (Symbol.explode name));
   741     fun vary2 c = if ((c ^ u) mem_string bs) then vary2 (bump_string c) else c;
   741     fun vary2 c = if ((c ^ u) mem_string bs) then vary2 (Symbol.bump_string c) else c;
   742     fun vary1 c = if ((c ^ u) mem_string bs) then vary2 (c ^ "a") else c;
   742     fun vary1 c = if ((c ^ u) mem_string bs) then vary2 (c ^ "a") else c;
   743   in vary1 (if c = "" then "u" else c) ^ u end;
   743   in vary1 (if c = "" then "u" else c) ^ u end;
   744 
   744 
   745 (*Create variants of the list of names, with priority to the first ones*)
   745 (*Create variants of the list of names, with priority to the first ones*)
   746 fun variantlist ([], used) = []
   746 fun variantlist ([], used) = []