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 WAA31208; Sun, 16 Mar 2003 22:07:05 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA31161 for caml-list@pauillac.inria.fr; Sun, 16 Mar 2003 22:07:03 +0100 (MET) 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 WAA16802 for ; Fri, 14 Mar 2003 22:18:00 +0100 (MET) Received: from blueyonder.co.uk (pcow058o.blueyonder.co.uk [195.188.53.98]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2ELHxX09870 for ; Fri, 14 Mar 2003 22:18:00 +0100 (MET) Received: from onyx ([62.31.78.17]) by blueyonder.co.uk with Microsoft SMTPSVC(5.5.1877.757.75); Fri, 14 Mar 2003 21:17:46 +0000 To: "caml-list@pauillac.inria.fr" Cc: brogoff@speakeasy.net, Seth Kurtzberg , Max Kirillov Subject: Re: [Caml-list] Re: Haskell-like syntax References: From: Sebastien Carlier Date: 14 Mar 2003 21:17:29 +0000 In-Reply-To: Message-ID: <87of4dbqc6.fsf@wise.homedns.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; caml-list:01 haskell-like:01 brogoff:01 camlp:01 foo:01 checker:01 haskell:01 compilers:01 ocaml:01 speakeasy:01 int:01 rec:01 writes:01 syntax:02 string:03 X-Spam: no; 0.00; caml-list:01 haskell-like:01 brogoff:01 camlp:01 foo:01 checker:01 haskell:01 compilers:01 ocaml:01 speakeasy:01 int:01 rec:01 writes:01 syntax:02 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk brogoff@speakeasy.net writes: > If you are really desparate to be able to do this kind of thing, that is, to > write your programs in a top down fashion, you can do it right now in OCaml, > sans CamlP4, by writing code like > > let rec main () = > let foo_arg = foo_aux () in > foo foo_arg > and foo = ... > and foo_aux = ... This is different: "let rec" doesn't give you polymorphism in OCaml. The following code doesn't pass the type checker because the type of "id" is not generalized: let rec main () = print_string (id ""); print_int (id 0) and id = fun x -> x;; In Haskell, "where" generalizes - the following similar code is accepted by Haskell compilers: main = do putStr (id "") print (id 0) where id = \ x -> x -- Sebastien ------------------- 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