From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA26779; Thu, 10 Jun 2004 22:50:28 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA26380 for ; Thu, 10 Jun 2004 22:50:27 +0200 (MET DST) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5AKoPEV031532 for ; Thu, 10 Jun 2004 22:50:26 +0200 Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id i5AKoCG16459; Thu, 10 Jun 2004 15:50:13 -0500 (CDT) Date: Thu, 10 Jun 2004 15:56:06 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Diego Olivier Fernandez Pons cc: caml-list@inria.fr Subject: Re: [Caml-list] Assert fail in partial application In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 40C8C991.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 pons:01 val:01 val:01 fernandez:01 int:01 int:01 olivier:02 assert:02 assert:02 exception:02 exception:02 wrote:03 compiling:03 partial:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 10 Jun 2004, Diego Olivier Fernandez Pons wrote: > Bonjour, > > I would like a function that contains an assert to fail in partial > application and the test are still removed when compiling in noassert > mode > > # let f = fun x y -> assert (x > 0); assert (y > 0); x + y > val f : int -> int -> int > # f 0;; > - : int -> int = > # f 0 0;; > Exception: Assert_failure (" ", 1, 19). This seems to work: # let f x = assert (x > 0); fun y -> x + y;; val f : int -> int -> int = # f 0;; Exception: Assert_failure ("", 1, 10). # -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners