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 TAA25108; Wed, 7 Apr 2004 19:30:34 +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 TAA25242 for ; Wed, 7 Apr 2004 19:30:33 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from mwinf0202.wanadoo.fr (smtp2.wanadoo.fr [193.252.22.29]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i37HVPjq003985 for ; Wed, 7 Apr 2004 19:31:25 +0200 Received: from vanicat.homelinux.org (ca-bordeaux-2-23.w80-8.abo.wanadoo.fr [80.8.74.23]) by mwinf0202.wanadoo.fr (SMTP Server) with ESMTP id 5B83FA400345 for ; Wed, 7 Apr 2004 19:30:32 +0200 (CEST) Received: from moi by vanicat.homelinux.org with local (Exim 4.31) id 1BBGtD-0007rf-5m for caml-list@inria.fr; Wed, 07 Apr 2004 19:31:03 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] Function forward declaration? References: <60532B15DF92FD4693AA89B2F7E01D8F013F29EC@tmex02> <00cf01c41bd6$391b53a0$0203a8c0@hoedic> <20040406175320.GA19840@redhat.com> <1081279717.16531.6.camel@qrnik> <002901c41c65$b53e4c50$19b0e152@warp> <1081345936.19232.579.camel@pelican> <20040407141519.GA6618@redhat.com> <1081353080.19232.678.camel@pelican> <20040407164122.GA9247@redhat.com> From: Remi Vanicat Mail-Copy-To: never Date: Wed, 07 Apr 2004 19:31:02 +0200 In-Reply-To: <20040407164122.GA9247@redhat.com> (Richard Jones's message of "Wed, 7 Apr 2004 17:41:22 +0100") Message-ID: <87r7uzhezt.dlv@vanicat.homelinux.org> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 'return':99 dbh:99 userid:99 permissions:01 userid:99 dbh:99 ocaml:01 ocaml:01 writes:01 remi:01 remi:01 vanicat:01 vanicat:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 99 Richard Jones writes: > On Thu, Apr 08, 2004 at 01:51:21AM +1000, skaller wrote: >> > (Same, by the way, goes for a 'return' statement which OCaml is crying >> > out for). >> >> I don't think it makes any sense in Ocaml. > [...] > > This is the sort of thing which I'd like to write. Note not only the > return statement, but also the regular expression support: Let do it without return nor exception : let run dbh q userid = if check_permissions userid = Failed then ( StdPages.error q "Sorry, but you don't have permission to see this" ) else let query = q#param "query" in if query =~ /^\s*$/ then ( StdPages.error q "Please enter a query" ) else let resource = try find_resource dbh query with Not_found -> StdPages.error q "That resource doesn't exist in the database" in (* Do lots and lots of real processing here. *) StdPages.ok q "OK, your query was executed" I don't see what is your problem here... -- Rémi Vanicat ------------------- 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