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 JAA24075; Wed, 5 Nov 2003 09:57:22 +0100 (MET) 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 JAA24295 for ; Wed, 5 Nov 2003 09:57:21 +0100 (MET) Received: from bob.west.spy.net (mail.west.spy.net [66.149.231.226]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hA58vK110282 for ; Wed, 5 Nov 2003 09:57:20 +0100 (MET) Received: from [192.168.1.196] (dhcp-196.west.spy.net [192.168.1.196]) by bob.west.spy.net (Postfix) with ESMTP id 7CB595818 for ; Wed, 5 Nov 2003 00:57:18 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v606) Content-Transfer-Encoding: 7bit Message-Id: <0F0B3332-0F6E-11D8-85C9-000393CFE6B8@spy.net> Content-Type: text/plain; charset=US-ASCII; format=flowed To: Caml Mailing List From: Dustin Sallings Subject: [Caml-list] function overloading Date: Wed, 5 Nov 2003 00:57:18 -0800 X-Mailer: Apple Mail (2.606) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; bool:01 bool:01 overloading:01 int:01 int:01 match:02 argument:03 poly:04 let:04 seems:05 pattern:06 pattern:06 type:07 type:07 i'm:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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)? -- Dustin Sallings ------------------- 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