From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D72BEBC6B for ; Wed, 23 May 2007 13:02:40 +0200 (CEST) Received: from smtp002.mail.ukl.yahoo.com (smtp002.mail.ukl.yahoo.com [217.12.11.33]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l4NB2eSu018932 for ; Wed, 23 May 2007 13:02:40 +0200 Received: (qmail 26272 invoked from network); 23 May 2007 11:02:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Received:X-YMail-OSG:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=t7gPmK6YymaQMTQR3FtAGEPbSPmY9/gsbuoQo0/fs9rgmGiitp0wTbTBmFWOrGKqUYMOSNsK53hN+SDpmRcYW+gwIVDAKq1x2rIAnIFtebTBnwrfw6bsg2tZQgcIwbsKB6LXjyxiicMLQCEop21neAdpFAz1dqW2r/KIgDyQaPY= ; Received: from unknown (HELO ?192.168.0.10?) (vincent.aravantinos@82.229.199.66 with plain) by smtp002.mail.ukl.yahoo.com with SMTP; 23 May 2007 11:02:40 -0000 X-YMail-OSG: 4d2muOoVM1nfYFhavXmIS5L7QZOgVLrMLisnC6jC5svAZP0Y Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <20070523100002.6B193BC73@yquem.inria.fr> References: <20070523100002.6B193BC73@yquem.inria.fr> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3A6A724D-68A1-4D21-8EF8-7B39F64110E6@yahoo.fr> Content-Transfer-Encoding: 7bit From: Vincent Aravantinos Subject: Re: Re: Teaching bottomline, part 3: what should improve. Date: Wed, 23 May 2007 13:00:51 +0200 To: caml-list@yquem.inria.fr X-Mailer: Apple Mail (2.752.2) X-Miltered: at concorde with ID 46541F50.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 beginner's:01 2007,:98 wrote:01 imho:01 functions:01 functions:01 surprising:01 match:02 programming:03 context:04 fold:06 wed:06 programmer:06 indeed:07 On Wed, 23 May 2007, Loup Vaillant wrote : > (...) >> * Anonymous functions are still beyond most of them. > > That sounds surprising, for anonymous function are no different > from named ones: > > 5;; (* a value *) > fun x -> x+1;; (* another value, which happens to be a function *) Those are typically the comments of a "used-to-functional- programming" guy. It certainly doesn't match what a beginner would think (no beginner will call a function a "value"). Or do you really think that seeing functions as first-class object is the natural way ? IMHO this is not the case, and therefore not the case of a beginner. To my eyes, there are (I mean, "in human mind" or at least in an ocaml beginner's mind) values AND functions. A function turns into a value (in the mind of the programmer) only when it is used by a higher order function. > a = 5;; (* a bound value *) > b = fun x -> x+1;; (* another bound value, which happens to be a > function *) > > Did your students used map and fold-like functions much? These almost > require anonymous functions. Indeed, using map and fold puts the focus on the fact that functions _can_ be values. Thus their importance in a pedagogical context. Maybe all this is just a matter of belief... Regards, Vincent