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
What does Jane Street use/want for an IDE? What about you?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-10-26 (19:49)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: Indentation (was Re: [Caml-list] What does Jane Street use/want for an IDE? What about you?)
Daniel Bünzli wrote:
> Le 26 oct. 08 ŕ 01:08, Martin Jambon a écrit :
>> In performance-critical code or maybe imperative code in general, it
>> feels good to control when closures are created. In such cases, avoiding
>> local functions helps.
> Just to be clear, naming your anonymous function locally (which is what
> is recommended) or not naming it doesn't make any performance difference

What I mean is that:

let f x y = x + y

let g x l =
  List.map (f x) l

is clearer than:

let g x l =
  let f y = x + y in
  List.map f l

in the sense that it is obvious that a closure is created in the first
case, while it is less visible in the second case.