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 KAA14358; Tue, 18 Mar 2003 10:47:57 +0100 (MET) 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 KAA14426 for ; Tue, 18 Mar 2003 10:47:56 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from web11007.mail.yahoo.com (web11007.mail.yahoo.com [216.136.131.57]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id h2I9lsf26762 for ; Tue, 18 Mar 2003 10:47:55 +0100 (MET) Message-ID: <20030318094753.37572.qmail@web11007.mail.yahoo.com> Received: from [24.189.36.21] by web11007.mail.yahoo.com via HTTP; Tue, 18 Mar 2003 01:47:53 PST Date: Tue, 18 Mar 2003 01:47:53 -0800 (PST) From: Sergey Goldgaber Subject: Re: [Caml-list] poll - need for a good introductory OCaml book (LONG) To: Pierre Weis Cc: William Lovas , Caml-list In-Reply-To: <20030318093223.I30420@latour.inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; sergey:99 caml-list:01 introductory:99 pierre:01 weis:01 command-line:01 gui:01 beginners:01 dedication:99 stdin:01 commenting:01 semicolons:01 semicolon:01 recursion:01 platinum:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --- Pierre Weis 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 programming > 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 you > 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 helpful. 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 OCaml... some statements are delimited by semicolons, others not... I was once very confused until someone pointed out that the last statement 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 to the functional style and recursion. Especially how some algorithms are arrived at and how they work. I am still wrestling with these issues. Hope that helps. And thanks again for your work! --Sergey __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com ------------------- 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