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 XAA31457; Fri, 8 Jun 2001 23:39:57 +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 XAA31196 for ; Fri, 8 Jun 2001 23:39:57 +0200 (MET DST) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f58Ldsn23446 for ; Fri, 8 Jun 2001 23:39:55 +0200 (MET DST) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id OAA24141; Fri, 8 Jun 2001 14:39:49 -0700 (PDT) Date: Fri, 8 Jun 2001 14:39:49 -0700 (PDT) From: Brian Rogoff To: Mattias Waldau cc: caml-list@inria.fr Subject: Re: Why is Ocaml better than Java (WAS: [Caml-list] ocaml complexity) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 8 Jun 2001, Mattias Waldau wrote: > The real questions is how to convince a Java-programmer to start using > Ocaml. > > The arguments I can list is: ... > - closures (however can always be programmed using local class with > ()-method) > - better typechecking makes higher order functions simple to use (however, I > think that a local class in Java will be as good) ... - block structure with lexical scope C derived languages are relatively flat; yeah you can have nested scopes but you can't nest function definitions. I hate that. Pascal derived languages are much nicer in this respect, but they always have restrictions on what you can do with functions. So ML style closures will be a lot nicer than Java style closures faked with objects since you don't have to explicitly make the local variables into arguments. I'll post an example if you wish, but I sent one to compl.lang.ml a few months ago when some Python programmer was asking for examples of what you could do in ML that you couldn't easily do in Python. I think Python is fixed now, but Java is still broken. So is C++ (sorry Chris, couldn't resist ;-). -- Brian ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr