Posted: Mar 20, 2012 5:22 pm
by Sigillum Militum
VazScep wrote:With generics, the correct solution can be achieved, but that solution is the Standard ML/Ocaml solution: you make TreeSet a class/module which is parametrised on a type which implements the interface/signature Comparable. Of course, generics were added to Java and C# by Haskell and ML researchers.

Yeah I guess generics is a more appropriate comparison. Prollum is, I don't use Java or C# or C++ so they didn't come to mind immediately.

VazScep wrote:In Ocaml, if I want to derive new syntax, I have to learn the language and API of Camlp4. I have yet to do this, but it looks like a headache.

One of the best (pseudo-)syntactic modifications is |>, which is two lines in Batteries.