src/Pure/context.ML
changeset 18711 cf020c54e2f5
parent 18678 dd0c569fa43d
child 18731 3989c3c41983
equal deleted inserted replaced
18710:527aa560a9e0 18711:cf020c54e2f5
    60   val >> : (theory -> theory) -> unit
    60   val >> : (theory -> theory) -> unit
    61   val ml_output: (string -> unit) * (string -> unit)
    61   val ml_output: (string -> unit) * (string -> unit)
    62   val use_mltext: string -> bool -> theory option -> unit
    62   val use_mltext: string -> bool -> theory option -> unit
    63   val use_mltext_theory: string -> bool -> theory -> theory
    63   val use_mltext_theory: string -> bool -> theory -> theory
    64   val use_let: string -> string -> string -> theory -> theory
    64   val use_let: string -> string -> string -> theory -> theory
    65   val add_setup: (theory -> theory) list -> unit
    65   val add_setup: (theory -> theory) -> unit
    66   val setup: unit -> (theory -> theory) list
    66   val setup: unit -> theory -> theory
    67   (*proof context*)
    67   (*proof context*)
    68   type proof
    68   type proof
    69   val theory_of_proof: proof -> theory
    69   val theory_of_proof: proof -> theory
    70   val transfer_proof: theory -> proof -> proof
    70   val transfer_proof: theory -> proof -> proof
    71   val init_proof: theory -> proof
    71   val init_proof: theory -> proof
   474 
   474 
   475 (* use ML text *)
   475 (* use ML text *)
   476 
   476 
   477 val ml_output = (writeln, Output.error_msg);
   477 val ml_output = (writeln, Output.error_msg);
   478 
   478 
   479 fun use_output verbose txt = use_text ml_output verbose (Symbol.escape txt);
   479 fun use_output verbose txt =
       
   480   Output.ML_errors (use_text ml_output verbose) (Symbol.escape txt);
   480 
   481 
   481 fun use_mltext txt verbose opt_thy = setmp opt_thy (fn () => use_output verbose txt) ();
   482 fun use_mltext txt verbose opt_thy = setmp opt_thy (fn () => use_output verbose txt) ();
   482 fun use_mltext_theory txt verbose thy = #2 (pass_theory thy (use_output verbose) txt);
   483 fun use_mltext_theory txt verbose thy = #2 (pass_theory thy (use_output verbose) txt);
   483 
   484 
   484 fun use_context txt = use_mltext_theory ("Context.>> (" ^ txt ^ ");") false;
   485 fun use_context txt = use_mltext_theory ("Context.>> (" ^ txt ^ ");") false;
   488 
   489 
   489 
   490 
   490 (* delayed theory setup *)
   491 (* delayed theory setup *)
   491 
   492 
   492 local
   493 local
   493   val setup_fns = ref ([]: (theory -> theory) list);
   494   val setup_fn = ref (I: theory -> theory);
   494 in
   495 in
   495   fun add_setup fns = setup_fns := ! setup_fns @ fns;
   496   fun add_setup f = setup_fn := (! setup_fn #> f);
   496   fun setup () = let val fns = ! setup_fns in setup_fns := []; fns end;
   497   fun setup () = let val f = ! setup_fn in setup_fn := I; f end;
   497 end;
   498 end;
   498 
   499 
   499 
   500 
   500 
   501 
   501 (*** proof context ***)
   502 (*** proof context ***)