November 2011 Archives

Ocaml Pet Peeve

While I generally like Ocaml (as some of you may have guessed), there is one pet peeve of mine with the language: record fields names are module wide rather than record specific. For example:

type t = { blah : int }

The record field blah is now a module wide name so I cannot reuse it. Thus, field names that happen to be useful in two contexts are not allowed. Although, to be honest, having two record names the same is probably a sign of a refactor point.

About cyocum

user-pic Celticist, Computer Scientist, Nerd, sometimes a poet…