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
[Caml-list] Generating C stubs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-05-21 (19:15)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] Camlp4/OCaml [was: Generating C stubs]
Pierre Weis wrote:
>>FAIW, let me say I'm shedding blood to make my code compile 
>>when I raise exceptions that have non banal type lists: I 
>>always misplace my parentheses.
> Have you ever read the programming guidelines that explain the
> ``secrets'' of Caml parentheses ?
> http://pauillac.inria.fr/caml/FAQ/pgl-eng.html
> Section IV: When to use parentheses within an expression
> If you learn the rules, if you follow those guidelines, and still
> experience problems, please let me know, since I used those simple
> principles for years with thousands of students (I really mean several
> thousands students not several students) and they had no problems once
> they had understood and learned those rules.

Thanks for mentioning them. All the documentation I have on 
Ocaml now is the "official" html manual, but the syntax part 
is not human-readable. I was never actually taught Ocaml, 
but rather I learned it (if I ever did) by writing code and 
trying to get it to compile. I never had problems figuring 
out the meaning and usage of type lists in constructors, 
with the sole exception of exceptions. Somehow, they have 
always escaped my inductive learning ability. I'll try 
reading the guidelines.

> On the other hand, I agree with you that if you don't know the rules
> for parens in Caml, you certainly should have problems to write your
> programs. This is the same problems as the one of young people at
> school that use to claim that mathematics _HAVE_ (*) syntactic
> problems because they never know where to put parens in

I have absolutely no authority to criticize the syntax; I 
just claim that some aspects of it are not user-friendly. 
Math transcends user-friendliness. It simply is not meant to 
be used in any definite way. It just sits there, exists. (I 
once heard an algebraist wonder if category theory had any 
*real* use.) Software systems, on the other hand, must be 
used by humans in order to be worth creating, and, for this 
reason, they ought to be as intuitive as possible. I still 
have not had time to mess with CamlP4 and cannot say much 
about it, but if its syntax is more intuitive than the 
native one, then welcome CamlP4.

Alex Baretta

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