src/Pure/Isar/isar_cmd.ML
changeset 22604 6419dcc822f1
parent 22602 a165d9ed08b8
child 22872 d7189dc8939c
--- a/src/Pure/Isar/isar_cmd.ML	Thu Apr 05 00:30:31 2007 +0200
+++ b/src/Pure/Isar/isar_cmd.ML	Thu Apr 05 00:30:32 2007 +0200
@@ -494,7 +494,8 @@
 val thy_deps = Toplevel.unknown_theory o Toplevel.keep (fn state =>
   let
     val thy = Toplevel.theory_of state;
-    val gr = rev (thy :: Theory.ancestors_of thy) |> map (fn node =>
+    val all_thys = sort Context.thy_ord (thy :: Theory.ancestors_of thy);
+    val gr = all_thys |> map (fn node =>
       let
         val name = Context.theory_name node;
         val parents = map Context.theory_name (Theory.parents_of node);