Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It could be worthwhile if this proposal were implemented:

http://docs.google.com/Doc.aspx?id=k73_1ggr36h

"Here is the same code rewritten using the proposed syntax:"

    List<String> ls = ... ;
    Collections.sort(ls,
        Comparator<String>(String s1, String s2){ return s1.length() - s2.length(); });
By making anonymous inner class declaration more concise, you get many of the benefits of closures, without changing Java semantics.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: