CookBook/antiquote_setup_plus.ML
author Christian Urban <urbanc@in.tum.de>
Thu, 02 Oct 2008 04:48:41 -0400
changeset 15 9da9ba2b095b
child 26 2311f81d7a22
permissions -rw-r--r--
added a solution section and some other minor additions

(*
Auxiliary antiquotations for the Cookbook.

*)

local structure O = ThyOutput
in
  fun check_exists f = 
    if File.exists (Path.explode ("~~/src/" ^ f)) then ()
    else error ("Source file " ^ quote f ^ " does not exist.")
  
  val _ = O.add_commands
   [("ML_file", O.args (Scan.lift Args.name) (O.output (fn _ => fn name =>
         (check_exists name; Pretty.str name))))];

end