But that is just syntactic sugar around the fact that Java does not have
first class functions. At least not in the sense Go does.

On Sat, Oct 8, 2016, 17:31 Pietro Gagliardi <andl...@lostsig.net> wrote:

> In Java, if an interface contains exactly one method, and that method is
> not already part of java.lang.Object, the syntax
>
> Interface i = (arguments) -> {
> code
> };
>
> will make an object i of that interface type with the given closure as the
> method body. This interface is called a functional interface.
>
> Pre-Java 8, the same thing could be done with
>
> Interface i = new Interface() {
> public void method() {
> code
> }
> };
>
> These interface literals are different from Go's interface literals.
>
> On Oct 8, 2016, at 11:24 AM, Jan Mercl <0xj...@gmail.com> wrote:
>
>
>
> On Sat, Oct 8, 2016, 16:39 Pietro Gagliardi <andl...@lostsig.net> wrote:
>
>
>
> Go does not have functional interfaces or interface literals.
>
>
> I don't know what is meant by 'functional interfaces' but Go definitely
> supports interface literals.
>
> --
>
> -j
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to