From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D2399BC2F for ; Fri, 26 Nov 2004 04:01:19 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAQ31JCD004544 for ; Fri, 26 Nov 2004 04:01:19 +0100 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 EAA10110 for ; Fri, 26 Nov 2004 04:01:18 +0100 (MET) Received: from miritek.com (v30-53.icu.ac.kr [210.107.130.53] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAQ31FXZ005361 for ; Fri, 26 Nov 2004 04:01:16 +0100 Received: from hama (v30-54.icu.ac.kr [210.107.130.54] (may be forged)) by miritek.com (8.9.3/8.9.3) with SMTP id MAA00547; Fri, 26 Nov 2004 12:14:42 +0900 Message-ID: <001101c4d365$4734b250$1501a8c0@hama> From: "SooHyoung Oh" To: "Michael Vanier" Cc: References: <3033.66.167.163.102.1101382830.squirrel@acs-webmail.ucsd.edu> <20041125205612.2A19E9BDA9@orchestra.cs.caltech.edu> <002601c4d351$74871cc0$1501a8c0@hama> <20041126014611.655389BDA9@orchestra.cs.caltech.edu> Subject: Re: [Caml-list] Experiences with learning OCaml? Date: Fri, 26 Nov 2004 12:09:00 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="ks_c_5601-1987" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Miltered: at nez-perce with ID 41A69C7F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41A69C7B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; compiler:01 caml-list:01 ocaml:01 ocaml:01 syntax:01 booleans:01 subset:01 syntax:01 semantics:01 polymorphism:01 beginners:01 subset:01 vanier:01 mvanier:01 compiler:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: I agree with you that the Ocaml is too complicated for a novice. We don't have to adhere to full set of Ocaml to introduce how to program, do we? For HTDP, I'm planning to reduce the syntax of Ocaml, and one example is the match-expression WITHOUT a guard. In HTDP, chapter 4 "Conditioal expressions and Functions" seems to be a part to teach boolean expressions and cond-expressions, As you know, match-expressions are widly used in ocaml, so, I think this chpater can be rewritten to introduce booleans and subset of match-expressions. This is why I said I need new examples. (What about section 4.3 "Pattern-matching: Introduction", and section 4.4 "Designing Pattern-matching Functions"?) What I want is not to teach the syntax and semantics of one programming langage but to teach how to find solutions from problems and how to describe them using a progamming language. In my thought, Ocaml is good for such purpose because it is a *functional* language ("functional" includes many things), and it has modern features such as - simple syntax :) - type system including polymorphism, - module system, - and OOP In conclusion, I don't try to teach all functionality of Ocaml for beginners but I'd like to show how to desing program using subset of Ocaml from which I wish they would get some inspiration. ----- Original Message ----- From: "Michael Vanier" To: Cc: Sent: Friday, November 26, 2004 10:46 AM Subject: Re: [Caml-list] Experiences with learning OCaml? > > From: "SooHyoung Oh" > > Date: Fri, 26 Nov 2004 09:47:06 +0900 > > > > Anyway, in my experience, the difficult parts to convert are > > 1. cond-expression -> should be rewritten using pattern-matching; need new > > examples > > cond is very often used for the equivalent of pattern matching in scheme. > If you need more flexibility you can always use pattern matching with a > when clause e.g. > > let n = 10 in > match n with > | m when m < 0 -> -1 > | m when m = 0 -> 0 > | m -> 1;; > > > 2. symbol information -> decide which one is better? strings or varient > > types? > > Symbols per se don't exist in ocaml (at least without using camlp4), and > the whole notion of code-as-data is foreign to the ocaml world (again, not > counting things like camlp4 and metaocaml), so some examples are going to > be pretty hard to translate. Still, you can learn a lot by translating > like this. I went through part 3.5 of SICP and translated the examples > into ocaml; the results were very interesting, though haskell would have > been more elegant for those examples because they all involved lazy > evaluation. > > I'm not sure how appropriate ocaml is as a beginner's language. I teach > both scheme and ocaml now, and ocaml is very well-liked by advanced > programmers (one of whom came up to me raving about his "programming > epiphany" after learning ocaml), but I think it would overwhelm beginners. > The syntax is pretty involved, for one thing, and there are just a lot of > concepts to learn. Cousineau and Mauny's book _The Functional Approach to > Programming_ is a good attempt to teach functional programming and ocaml > (actually caml-light, but it's basically the same) to a fairly naive > audience. > > Mike > >