News for hackers. Stuff that matters.
Re:Generics facilitators in Go by mcculley on Wednesday December 22, 2021 @03:19PM (#29654531)
I don’t think I understand what you mean. What would have been different about listener interfaces if lambdas and method references had been available?
Re:Generics facilitators in Go by jayd16 on Wednesday December 22, 2021 @09:26PM (#29657958)
Some examples here show the difference: https://stackoverflow.com/questions/4685563/how-to-pass-a-fu...

    addCallback(new Callable<Integer>() {
        public Integer call() {
            return callback();
        }
    });
vs

    addCallback(this::callback);
At least anonymous types meant you didn't have to manually name all your listener boilerplate.
Re:Generics facilitators in Go by mcculley on Saturday December 25, 2021 @01:53PM (#29685859)
Ah. Yeah, this would have made callbacks simpler in the case where there is only one method. I was thinking about JavaBeans EventObject/EventListener usage, which is so tedious, but enables introspection by tools.