--- a/src/Pure/General/path.ML Tue Oct 11 14:02:32 2005 +0200
+++ b/src/Pure/General/path.ML Tue Oct 11 14:02:33 2005 +0200
@@ -145,17 +145,15 @@
| (cs, e) => (Path [Basic (implode (Library.take (length cs - 1, cs)))], implode e)));
-(* evaluate variables *)
-
-fun eval env (Variable s) = rep (env s)
- | eval _ x = [x];
+(* expand variables *)
-fun evaluate env (Path xs) =
- Path (norm (List.concat (map (eval env) xs)));
+fun eval (Variable s) =
+ (case getenv s of
+ "" => error ("Undefined Isabelle environment variable: " ^ quote s)
+ | path => rep (unpack path))
+ | eval x = [x];
-val expand = evaluate (unpack o getenv);
-
-val position = Position.line_name 1 o quote o pack o expand;
-
+val expand = rep #> map eval #> List.concat #> norm #> Path;
+val position = expand #> pack #> quote #> Position.line_name 1;
end;