Posted: Mar 20, 2012 12:35 pm
by Sigillum Militum
VazScep wrote:Is F# or Ocaml your language of choice? Either's awesome. Do you manage to use either in your professional work?

OCaml and I do not currently have "professional work". My goal is to become a military intelligence analyst and I'm sure OCaml will have a place there.

VazScep wrote:It is used for single-dynamic-dispatch (a form of subtyping), which is something that Ocaml's modules cannot do.

Well of course not, they don't have late binding.

But you can, in some sense, "subclass" modules with a functor. I recently needed to key a hash table with pairs of big_ints. Since = chokes on big_ints for some reason, what I did was use the Hashtbl.Make functor to get equal to use eq_big_int

VazScep wrote:In Java, I would need to abstract over constructors, which I can't do. So I end up with a more convoluted design involving two interfaces, one for the returned type and one for the constructing function (typically called an "abstract factory"). Yuck.

Java is really bad.

VazScep wrote:IIn the end, most of the things that got me interested in CL were things that were done just as well if not better in statically typed functional languages. The only thing that left it unique were macros, whose utility I grossly overestimated.

Macros are a shitty form of encapsulation and, from what I'm told, very difficult to debug.