, 14:03 Remi Forax wrote:
>
>
> --
>
> *De: *"Christopher Smith"
> *À: *"dev"
> *Envoyé: *Jeudi 29 Avril 2021 19:38:27
> *Objet: *Re: () call-type syntax for functional interfaces?
>
> Also an object implementing multiple
> De: "Christopher Smith"
> À: "dev"
> Envoyé: Jeudi 29 Avril 2021 19:38:27
> Objet: Re: () call-type syntax for functional interfaces?
> Also an object implementing multiple functional interfaces. In dynamic mode,
> you
> wouldn't know which metho
Also an object implementing multiple functional interfaces. In dynamic
mode, you wouldn't know which method to invoke.
On Thu, Apr 29, 2021, 12:34 Jochen Theodorou wrote:
> On 29.04.21 15:32, Christopher Smith wrote:
> > Sure, this is theoretically possible (though many functional interfaces
> >
On 29.04.21 15:32, Christopher Smith wrote:
Sure, this is theoretically possible (though many functional interfaces
aren't annotated), but the convenience I'm asking about would have to be
compile-time, because it would depend on the declared type (which is
part of why I suspect it might not even
objectExpression.
https://issues.apache.org/jira/browse/GROOVY-5881 is a good ticket to look at
and see how even the "call" substitution is limited in reality.
From: Christopher Smith
Sent: Thursday, April 29, 2021 8:33 AM
To: dev@groovy.apache.org
Subject: Re: () call-type syntax for fu
Sure, this is theoretically possible (though many functional interfaces
aren't annotated), but the convenience I'm asking about would have to be
compile-time, because it would depend on the declared type (which is part
of why I suspect it might not even make semantic sense in the underlying
dynamic
Sorry if I might be teaching people to suck eggs, but you can discover the
functional method of a functional interface through reflection. It’s a bit of a
lookup but presumably in groovy the results of such lookups do get cached...
I use (reassembled from something that’s a bit more broken up th
That option is not available when using, for example,
java.util.function.Function.
On Thu, Apr 29, 2021, 03:34 Angelo Schneider
wrote:
> Is that not already covered by the call() - method?
> I mean the option to declare a method called `Object call(args)´
> Best Regards
> Angelo
>
> ---
> Angelo
Is that not already covered by the call() - method?
I mean the option to declare a method called `Object call(args)´
Best Regards
Angelo
---
Angelo Schneider
angelo.schnei...@oomentor.de
+49 172 9873893
> Am 29.04.2021 um 02:47 schrieb Christopher Smith :
>
> It would be convenient to be able to
It would be convenient to be able to use the convention of "use
parentheses on a function-like object" with functional interfaces; for
example, if a variable is declared as type Function, to have
`myVar(3)` run `myVar.apply(3)`. Is there any chance this would be
practical, or would its semantics be
10 matches
Mail list logo