21 Mar 2004 mslicker   » (Journeyer)

ncm, I don't think you understand, what I have done is not to implement Ocaml in Ocaml, I have expressed a simple recursive function which happens to be a library function.

Ocaml includes "map" as a function expressed in Ocaml, here is how they define it:

let rec map f = function
    [] -> []
  | a::l -> let r = f a in r :: map f l

I not quite sure why they do it this way, I think they use pattern matching because of the the builtin error reporting, let r = f a in r :: map f l could be expressed: f a :: map f l .

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!