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 VAA01926; Thu, 24 Jun 2004 21:57:38 +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 VAA02557 for ; Thu, 24 Jun 2004 21:57:37 +0200 (MET DST) Received: from mail.cs.unm.edu (webmail.cs.unm.edu [64.106.20.39]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5OJvZSH002212 for ; Thu, 24 Jun 2004 21:57:36 +0200 Received: from hobbs.cs.unm.edu ([64.106.21.108]) by mail.cs.unm.edu with esmtp (Exim 3.35 #1 (Debian)) id 1BdaLf-0000rh-00; Thu, 24 Jun 2004 13:57:27 -0600 Date: Thu, 24 Jun 2004 13:57:27 -0600 (MDT) From: "William D. Neumann" To: John Hughes cc: "'caml-list'" Subject: RE: [Caml-list] Why must types be always defined at the top level? In-Reply-To: <20040624194603.2A91010EF06@clark.cs.brown.edu> Message-ID: References: <20040624194603.2A91010EF06@clark.cs.brown.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanner: exiscan *1BdaLf-0000rh-00*KIRJ0V4ikmA* X-Miltered: at concorde with ID 40DB322F.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 val:01 annotating:01 cobol:01 bool:01 ints:01 lisp:01 int:01 int:01 wrote:03 neumann:03 neumann:03 types:03 types:03 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 24 Jun 2004, John Hughes wrote: > This from someone who uses "int" to mean something other than > "integer"! :-) Ah, but "real" = "real", but "int" <> "integer". /clutching at straws? > 5. Why can I no longer type-annotate things I've written, so that > > let f x y z = (x = y) & (y = z) > > defines a function applicable to ALL types? I actually *liked* > being able to say something like > > let f x y z:int = (x = y) && (y = z) > > so that it would be restricted to ints. You can do this. You just need to do: # let f x y (z:int) = (x = y) & (y = z);; val f : int -> int -> int -> bool = What you have above is annotating f, not z. William D. Neumann --- "Well I could be a genius, if I just put my mind to it. And I...I could do anything, if only I could get 'round to it. Oh we were brought up on the space-race, now they expect you to clean toilets. When you've seen how big the world is, how can you make do with this? If you want me, I'll be sleeping in - sleeping in throughout these glory days." -- Jarvis Cocker Think of XML as Lisp for COBOL programmers. -- Tony-A (some guy on /.) ------------------- 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