Yannick Loiseau

Results 76 comments of Yannick Loiseau

Sorry, I'd forgotten that `to` already exists...

As a side note, it's no more a `MethodHandle` augmentation, but a `FunctionReference` method.

```golo require( 1 == java.util.Collections.min( list[5, 1, 2, 3], asInterfaceInstance( java.util.Comparator.class, |a, b| -> Integer.compare(a, b))), "err") ``` works as expected...

It should be automatically converted, but we have a bug in identifying SAM since 1.8, since now interfaces can have default methods. The `asInterfaceInstance` is a way to force the...

Moreover, `Comparator` *is* a functional interface, so it should work. Indeed, ```golo require( 1 == java.util.Collections.min( list[5, 1, 2, 3], asFunctionalInterface( java.util.Comparator.class, |a, b| -> Integer.compare(a, b))), "err") ``` fails...

I actually have 2 old branches try to fix this aspect (https://github.com/yloiseau/golo-lang/tree/improvement/java-function-integration and https://github.com/yloiseau/golo-lang/tree/wip/java-function-integration) if someone wants to have a look :smile:

Here are some minimal tests: ```java @FunctionalInterface public interface FI { int get(); } @FunctionalInterface public interface FiWithDefault { int get(); default int apply() { return get() + 1; }...

This feature will also allow to have homogeneous macros calls (see #347)

Some tests show that it is actually more difficult to adapt the grammar. Indeed, construct such as ``` golo if foo(42) { doPlop() } ``` will be interpreted as ```...

I think the way to go is to not change the grammar, which should indeed be possible but at the cost of a more complex one, but to post-process the...