Why does `ScopedValue.where(SCOPE_VALUE, val).call()` throw Exception?

Andrew Haley aph-open at littlepinkcloud.com
Mon Mar 27 09:34:19 UTC 2023


On 3/25/23 09:15, Alan Bateman wrote:
> 
> 
> On 24/03/2023 21:58, Andrew Haley wrote:
>> On 3/24/23 13:23, Josiah Noel wrote:
>>> It would be the same as call, except that it takes a supplier as an
>>> input
>>> and returns the supplier's result.
>>
>> Ah, I see. That makes sense.
>>
> Yes, although it would require a different method name, otherwise usages
> with lambda expressions would be ambiguous.

The existing practice uses call() for Callable.call() and run for Runnable.run();

Following that same practice, I'm thinking get() for Supplier.get();

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the loom-dev mailing list