315 \<close> |
315 \<close> |
316 |
316 |
317 See also commands 'export_generated_files' and 'compile_generated_files' |
317 See also commands 'export_generated_files' and 'compile_generated_files' |
318 to use the results. |
318 to use the results. |
319 |
319 |
320 * ML evaluation (notably via commands 'ML' and 'ML_file') is subject to |
320 * ML evaluation (notably via command 'ML' or 'ML_file') is subject to |
321 option ML_environment to select a named environment, such as "Isabelle" |
321 option ML_environment to select a named environment, such as "Isabelle" |
322 for Isabelle/ML, or "SML" for official Standard ML. It is also possible |
322 for Isabelle/ML, or "SML" for official Standard ML. |
323 to move toplevel bindings between environments, using a notation with |
|
324 ">" as separator. For example: |
|
325 |
|
326 declare [[ML_environment = "Isabelle>SML"]] |
|
327 ML \<open>val println = writeln\<close> |
|
328 |
|
329 declare [[ML_environment = "SML"]] |
|
330 ML \<open>println "test"\<close> |
|
331 |
|
332 declare [[ML_environment = "Isabelle"]] |
|
333 ML \<open>println\<close> \<comment> \<open>not present\<close> |
|
334 |
|
335 The Isabelle/ML function ML_Env.setup defines new ML environments. This |
|
336 is useful to incorporate big SML projects in an isolated name space, and |
|
337 potentially with variations on ML syntax (existing ML_Env.SML_operations |
|
338 observes the official standard). |
|
339 |
323 |
340 * ML antiquotation @{master_dir} refers to the master directory of the |
324 * ML antiquotation @{master_dir} refers to the master directory of the |
341 underlying theory, i.e. the directory of the theory file. |
325 underlying theory, i.e. the directory of the theory file. |
342 |
326 |
343 * ML antiquotation @{verbatim} inlines its argument as string literal, |
327 * ML antiquotation @{verbatim} inlines its argument as string literal, |