English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2001-06-08 (22:14)
From: Chris Hecker <checker@d...>
Subject: Re: Why is Ocaml better than Java (WAS: [Caml-list] ocaml complexity)

>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. 

Unless you want local types (or local exceptions for parameterized Breaks, like we discussed previously) to go with your local functions, in which case you have to wrap them in a local module, but you can't local open, so it's a lot like a nested class syntax-nastiness-wise, and you can't have record fields with the same name anyway, etc.  :)

In some sense, you trade heavyweight functions in C++ for heavyweight types in OCaml.  I won't defend that statement particularly strongly though, so don't bother attacking it with vigor.  :)

> So is C++ (sorry Chris, couldn't resist ;-).

I certainly think C++ is a pile, myself.  My point with that other comment was that I think "alternative language people" (whatever that means) like to bash C++ to the point where it becomes a habit, rather than it staying an engineering analysis of a different solution's strengths and weaknesses.


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