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] poll - need for a good introductory OCaml book (LONG)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-03-18 (09:47)
From: Sergey Goldgaber <sgoldgaber@y...>
Subject: Re: [Caml-list] poll - need for a good introductory OCaml book (LONG)
--- Pierre Weis <weis@latour.inria.fr> wrote:
> Have you had a look to
> http://pauillac.inria.fr/caml/Examples/oc/eng.html
> There are there a lot of examples from simple to extremely advanced,
> from simple command-line a.out style to rather involved GUI
> for an interactive Tetris game.
> Some of the examples are equipped with their C equivalent for you to
> compare with, some other have both an imperative and recursive
versions, and
> still other examples have 4 or 5 implementations from simple to higly
> functional style.
> I would be glad to incorporate other examples that you would think
> more appropriate for the beginners and/or comments or explanations
> could have.

Yes, many thanks for making this code available.  I can see that it
must have taken great dedication to write.

I looked at these examples at the start of my OCaml adventures, and
actually found the first few examples in the "basic" section to be
enormously useful, because  you kept at least a 1:1 ratio of comments
to lines of code, explaining even little things such as what
Sys.interactive meant and how to compile the code.  That was extemely

However, after a few examples that practice quickly dropped to few and
sometimes virtually no comments (as with explode, reverse_stdin, or
solitaire program, for example).  This would be fine if the code was
accompanying a text where the code was explained in detail.  But, on
their own, without very heavy commenting explaining not only the syntax
but the algorithms, the examples are of limited use to someone who
doesn't already know OCaml or another functional language.

Now, however, after going through about four OCaml tutorials, playing
with some toy problems on my own, and having read a full quarter of the
Cousineau and Mauny text (and having followed through on thier
exercises), I think I may be ready to tackle the examples again, which
are making much more sense now then when I first started.

On a related note, I think it might be of benefit to mention things I
remember finding particularly confusing when I first started out:

 - Where semicolons are and are not used is very inconsitent in
   some statements are delimited by semicolons, others not...
   I was once very confused until someone pointed out that the last
   in a block of code should not contain a semicolon (unlike the rest).
   Coming from a C background this took some getting used to.

 - Another confusing thing was why you needed an "in" section at all.
   I was used to execution starting as soon as you entered a function.

 - Of course, syntax was really a minor issue compared to getting used
   the functional style and recursion.  Especially how some algorithms
   arrived at and how they work.  I am still wrestling with these

Hope that helps.  And thanks again for your work!


Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

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