Is it possible to use Java lambdas?

Hello guys! :)

Is it possible to use Java lambdas in MPS? I tried to add BaseLanguage.jdk8 but I could not find how to use Java lambdas.

3 comments

No, lambdas have not be implemented for BaseLanguage. The baselanguage.collections language provides closures to BaseLanguage. Although intuitive to use, the syntax differs from Java lambdas.

Vaclav

 

1

Vaclav, can I for example to write something like this with closure?

Thread t = new Thread(() -> {
        foo();
    });
0

Yes, you can. I look like this, though:

Thread t = new Thread({ => foo(); });

0

Please sign in to leave a comment.