Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] ocaml complexity
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Rogoff <bpr@b...>
Subject: Re: Why is Ocaml better than Java (WAS: [Caml-list] ocaml complexity)
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