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: Re: Teaching bottomline, part 3: what should improve.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-23 (11:02)
From: Vincent Aravantinos <vincent.aravantinos@y...>
Subject: Re: Re: Teaching bottomline, part 3: what should improve.
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...