value uses bare compiler invocation: generated code does not contain antiquotations
authorhaftmann
Thu, 30 Sep 2010 09:45:18 +0200
changeset 39796 b5f978f97347
parent 39795 9e59b4c11039
child 39801 3a7e2964c9c0
child 39809 dac3c3106746
value uses bare compiler invocation: generated code does not contain antiquotations
src/Pure/ML/ml_context.ML
--- a/src/Pure/ML/ml_context.ML	Thu Sep 30 09:31:07 2010 +0200
+++ b/src/Pure/ML/ml_context.ML	Thu Sep 30 09:45:18 2010 +0200
@@ -217,12 +217,13 @@
 
 fun value ctxt (get, put, put_ml) (prelude, value) =
   let
-    val read = ML_Lex.read Position.none;
-    val ants = read prelude @ read ("val _ = Context.set_thread_data (SOME (Context.map_proof (" ^ put_ml
+    val code = (prelude
+      ^ "\nval _ = Context.set_thread_data (SOME (Context.map_proof (" ^ put_ml
       ^ " (fn () => " ^ value ^ ")) (ML_Context.the_generic_context ())))");
     val ctxt' = ctxt
       |> put (fn () => error ("Bad evaluation for " ^ quote put_ml))
-      |> Context.proof_map (exec (fn () => eval false Position.none ants));
+      |> Context.proof_map (exec
+          (fn () => Secure.use_text ML_Env.local_context (0, "value") false code));
   in get ctxt' () end;
 
 end;