get_thydata accesses the second component of the data field. This component
authornipkow
Thu, 24 Apr 1997 18:03:23 +0200
changeset 3039 bbf4e3738ef0
parent 3038 bb2ded320911
child 3040 7d48671753da
get_thydata accesses the second component of the data field. This component used to be empty until set at the end of loading an ML file. Now the second component is already set when the thy file has ben read.
src/Pure/Thy/thy_read.ML
--- a/src/Pure/Thy/thy_read.ML	Thu Apr 24 18:00:22 1997 +0200
+++ b/src/Pure/Thy/thy_read.ML	Thu Apr 24 18:03:23 1997 +0200
@@ -44,7 +44,10 @@
                           init_thy_reader is invoked
         data: user defined data; exn is used to allow arbitrary types;
               first element of pairs contains result that get returned after
-              thy file was read, second element after ML file was read
+              thy file was read, second element after ML file was read;
+              if ML files has not been read, second element is identical to
+              first one because get_thydata, which is meant to return the
+              latest data, always accesses the 2nd element
        *)
 
 signature READTHY =
@@ -661,8 +664,8 @@
 
           val new_data = get_data (Symtab.dest methods) Symtab.null;
 
-          val data' = if thy_only then (new_data, snd data)
-                      else (fst data, new_data);
+          val data' = (if thy_only then new_data else fst data, new_data)
+                      (* 2nd component must be up to date *)
       in loaded_thys := Symtab.update
            ((tname, ThyInfo {path = path,
                              children = children, parents = parents,