From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 200D8BBAF for ; Tue, 24 Mar 2009 19:01:08 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnMCADS9yEmGhogUkWdsb2JhbACVaAEBAQEJCwoHEQW9DoN2Bg X-IronPort-AV: E=Sophos;i="4.38,413,1233529200"; d="scan'208";a="37130072" Received: from mga02.intel.com ([134.134.136.20]) by mail4-smtp-sop.national.inria.fr with ESMTP; 24 Mar 2009 19:01:06 +0100 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 24 Mar 2009 10:54:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,413,1233561600"; d="scan'208";a="500455121" Received: from unknown (HELO azsmsx001.amr.corp.intel.com) ([10.2.167.98]) by orsmga001.jf.intel.com with ESMTP; 24 Mar 2009 11:00:29 -0700 Received: from azsmsx501.amr.corp.intel.com ([10.2.167.99]) by azsmsx001.amr.corp.intel.com ([10.2.167.98]) with mapi; Tue, 24 Mar 2009 11:00:54 -0700 From: "Harrison, John R" To: OCaml Date: Tue, 24 Mar 2009 11:00:50 -0700 Subject: Stricter version of #use ? Thread-Topic: Stricter version of #use ? Thread-Index: Acmsqneyv+jqFfyoQwGKmlE3Ucewig== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam: no; 0.00; ocaml:01 nesting:01 failwith:01 val:01 val:01 camlp:01 camlp:01 exception:01 int:01 int:01 variant:02 caml:02 objective:02 let:03 let:03 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 =3D 1;; #use "branch.ml";; let y =3D 2;; and a file "branch.ml" containing let u =3D 3;; let v =3D failwith "X";; let w =3D 4;; Then I want the following to stop immediately on the failure inside "branch.ml" and hence not evaluate the "y =3D 2" line in "root.ml" as it currently does: Objective Caml version 3.10.0 # #use "root.ml";; val x : int =3D 1 val u : int =3D 3 Exception: Failure "X". val y : int =3D 2 On the other hand, I'd want it to keep the results of the x =3D 1 and u =3D 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.