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 LAA10134; Thu, 10 Jun 2004 11:06:42 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA10747 for ; Thu, 10 Jun 2004 11:06:41 +0200 (MET DST) Received: from cirse.extra.cea.fr (cirse.extra.cea.fr [132.166.172.102]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5A96eSH004214 for ; Thu, 10 Jun 2004 11:06:40 +0200 Received: from argiope.saclay.cea.fr (argiope.saclay.cea.fr [132.166.192.108]) by cirse.extra.cea.fr (8.12.10/CEAnet-Internet.3.0) with ESMTP id i5A96aTA028027 for ; Thu, 10 Jun 2004 11:06:36 +0200 (MEST) Received: from muguet.saclay.cea.fr (unverified) by argiope.saclay.cea.fr (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Thu, 10 Jun 2004 11:06:35 +0200 Received: from cea.fr (is002447.saclay.cea.fr [132.166.134.145]) by muguet.saclay.cea.fr (8.12.10/CEAnet-internes.3.0) with ESMTP id i5A96Xe5018591 for ; Thu, 10 Jun 2004 11:06:33 +0200 (MEST) Message-ID: <40C82469.50604@cea.fr> Date: Thu, 10 Jun 2004 11:05:45 +0200 From: Benjamin Monate Organization: CEA User-Agent: Mozilla Thunderbird 0.5 (X11/20040306) X-Accept-Language: fr-fr, en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Assert fail in partial application References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40C824A0.000 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 3.07:01 val:01 fernandez:01 caml:01 int:01 int:01 olivier:02 assert:02 assert:02 exception:02 exception:02 monate:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Bonjour, Diego Olivier Fernandez Pons wrote: > 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). What about : Objective Caml version 3.07+2 # let f x = assert (x>0) ; fun y -> assert (y>0) ; x+y;; val f : int -> int -> int = # f 0; ;; Exception: Assert_failure ("", 1, 10). # f 2 0 ;; Exception: Assert_failure ("", 1, 34). Hope this helps -- | Benjamin Monate ------------------- 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