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 JAA21766; Fri, 7 Nov 2003 09:06:35 +0100 (MET) 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 JAA17499 for ; Fri, 7 Nov 2003 09:06:33 +0100 (MET) Received: from mail2.tpgi.com.au (mail.tpgi.com.au [203.12.160.58]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hA786V112638 for ; Fri, 7 Nov 2003 09:06:32 +0100 (MET) Received: from syd-ts22-2600-229.tpgi.com.au (syd-ts22-2600-229.tpgi.com.au [203.26.30.229]) by mail2.tpgi.com.au (8.12.10/8.12.10) with ESMTP id hA786P6C030343; Fri, 7 Nov 2003 19:06:27 +1100 Subject: Re: [Caml-list] function overloading From: skaller Reply-To: skaller@ozemail.com.au To: Dustin Sallings Cc: Caml Mailing List In-Reply-To: <0F0B3332-0F6E-11D8-85C9-000393CFE6B8@spy.net> References: <0F0B3332-0F6E-11D8-85C9-000393CFE6B8@spy.net> Content-Type: text/plain Message-Id: <1068188723.6194.27.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 07 Nov 2003 18:05:23 +1100 Content-Transfer-Encoding: 7bit X-Kaspersky-Antivirus: Passed X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ozemail:01 g'caml:01 bool:01 bool:01 overloading:01 int:01 int:01 match:02 wrote:03 argument:03 poly:04 let:04 seems:05 pattern:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 2003-11-05 at 19:57, Dustin Sallings wrote: > I swear I found an example demonstrating how to do pattern matching > based on the type of an argument, but every pattern matching example I > can find now seems to be focused on value and not type. > > I'm trying to do something like this: > > let print_poly x = match x with > | (x: bool) -> print_bool x > | (x: int) -> print_int x > ;; > > Can someone tell me what I'm doing wrong (or perhaps tell me why I > shouldn't be doing this at all)? Try G'Caml. ------------------- 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