simplified Session.name;
authorwenzelm
Fri, 27 Jul 2012 12:43:58 +0200
changeset 48542 0a5f598cacec
parent 48541 f31ef1a0285a
child 48543 93b558e05f21
simplified Session.name;
src/Pure/System/session.ML
--- a/src/Pure/System/session.ML	Fri Jul 27 12:29:07 2012 +0200
+++ b/src/Pure/System/session.ML	Fri Jul 27 12:43:58 2012 +0200
@@ -21,24 +21,21 @@
 structure Session: SESSION =
 struct
 
-
 (* session state *)
 
 val session = Unsynchronized.ref ([Context.PureN]: string list);
-val session_path = Unsynchronized.ref ([]: string list);
 val session_finished = Unsynchronized.ref false;
-val remote_path = Unsynchronized.ref (NONE: Url.T option);
+
+fun id () = ! session;
+fun name () = "Isabelle/" ^ List.last (! session);
 
 
 (* access path *)
 
-fun id () = ! session;
-fun path () = ! session_path;
+val session_path = Unsynchronized.ref ([]: string list);
+val remote_path = Unsynchronized.ref (NONE: Url.T option);
 
-fun str_of [] = Context.PureN
-  | str_of elems = space_implode "/" elems;
-
-fun name () = "Isabelle/" ^ str_of (path ());
+fun path () = ! session_path;
 
 
 (* welcome *)
@@ -61,7 +58,7 @@
   let val sess = ! session @ [s] in
     (case duplicates (op =) sess of
       [] => (session := sess; session_path := ((if reset then [] else ! session_path) @ [s]))
-    | dups => error ("Duplicate session identifiers " ^ commas_quote dups ^ " in " ^ str_of sess))
+    | dups => error ("Duplicate session identifiers " ^ commas_quote dups))
   end;