[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Harrison, John R <john.r.harrison@i...> |
| Subject: | Stricter version of #use ? |
I'd like a variant of the #use directive for reading in an OCaml
source file, but with the property that it halts immediately on the
first error anywhere in a nesting of #use'd files. For example,
suppose you have a file "root.ml" containing
let x = 1;;
#use "branch.ml";;
let y = 2;;
and a file "branch.ml" containing
let u = 3;;
let v = failwith "X";;
let w = 4;;
Then I want the following to stop immediately on the failure inside
"branch.ml" and hence not evaluate the "y = 2" line in "root.ml" as it
currently does:
Objective Caml version 3.10.0
# #use "root.ml";;
val x : int = 1
val u : int = 3
Exception: Failure "X".
val y : int = 2
On the other hand, I'd want it to keep the results of the x = 1 and
u = 3 lines, not roll back everything. Is this easy to accomplish?
(By the way, I'm ultimately interested in using this together with
camlp5, and possibly with the new camlp4, if that makes a difference.)
John.