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 RAA27128; Mon, 5 Aug 2002 17: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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA27074 for ; Mon, 5 Aug 2002 17:50:27 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g75FoPD01052 for ; Mon, 5 Aug 2002 17:50:26 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g75FoKSs006322; Tue, 6 Aug 2002 01:50:20 +1000 (EST) Received: from ozemail.com.au (ppp153.dyn17.pacific.net.au [61.8.17.153]) by wisma.pacific.net.au with ESMTP id BAA28114; Tue, 6 Aug 2002 01:50:19 +1000 (EST) Message-ID: <3D4E9EBA.3010307@ozemail.com.au> Date: Tue, 06 Aug 2002 01:50:18 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Nicolas Cannasse CC: OCaml Subject: Re: [Caml-list] Matching when References: <000f01c23c62$3ec98150$0700a8c0@warp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Nicolas Cannasse wrote: >Hi ! > >I was thinking that the following should be possible : > >match e with >| Any >| Int x when x > 0 -> > .... (* here we don't use x *) >| .... > >But the typechecker reject it because of the unbound 'x' in the "Any" >matching. > Hmm. to rewrite it so it works: | Int _ when (match e with Int x -> x > 0 | _ -> assert false) -> ... :-) -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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