|
|
|
|
|
by litewulf
6400 days ago
|
|
Well, Java has Comparator classes. You can simply have first class functions by making a generic-d class (generic types for input and output), and a single member like "public T apply(F arg)". Its not that out of the ordinary. So the paradigm is easily replicated, but yes, the syntax is totally ugly though ;) I think the real difficulty is in explaining how say lots of Comparators and Function classes are better or worse than a first-class function. Java at least affords type-safety on the wrapped functions whereas Ruby and Python don't (though, they don't really have any Java-style type safety to begin with). |
|