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 WAA17357; Fri, 14 Mar 2003 22:51:21 +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 WAA17927 for ; Fri, 14 Mar 2003 22:51:19 +0100 (MET) From: brogoff@speakeasy.net Received: from grace.speakeasy.org (grace.speakeasy.org [216.254.0.2]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h2ELpIX10734 for ; Fri, 14 Mar 2003 22:51:18 +0100 (MET) Received: (qmail 9094 invoked by uid 36130); 14 Mar 2003 21:51:17 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 14 Mar 2003 21:51:17 -0000 Date: Fri, 14 Mar 2003 13:51:17 -0800 (PST) To: Sebastien Carlier cc: "caml-list@pauillac.inria.fr" , Seth Kurtzberg , Max Kirillov Subject: Re: [Caml-list] Re: Haskell-like syntax In-Reply-To: <87of4dbqc6.fsf@wise.homedns.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam: no; 0.00; brogoff:01 caml-list:01 haskell-like:01 recursion:01 annotate:01 dumped:01 camlp:01 foo:01 checker:01 haskell:01 compilers:01 ocaml:01 speakeasy:01 int:01 rec:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk That's a good point, though I have to say it hasn't been a problem in code I've written when I've wanted top down style. However, if this is such a bummer, maybe you should be agitating for polymorphic recursion instead. That would remove this complaint (if we didn't have to explicitly annotate; if we did, it loses the lightweight aspect) *and* add some power to OCaml. If I'm not mistaken, the Revised version of your code does not have that problem. Also, if you are really interested in making this happen, the right thing to do is to attempt to change Revised, which is the bucket that all syntax experimentation is dumped into. -- Brian On 14 Mar 2003, Sebastien Carlier wrote: > > 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