The philosophy of Nothing

Neal Gafter neal at gafter.com
Mon Nov 30 08:15:17 PST 2009


On Mon, Nov 30, 2009 at 2:23 AM, Reinier Zwitserloot <
reinier at zwitserloot.com> wrote:

> The need for Nothing is really quite simple. If I have the sort method:
>
> Collections.sort(someStringList, some instance of Comparator<String>)
>
> and I wish to call it like so:
>
> Collections.sort(someStringList, #(String a, String b) {
>    throw new IStillNeedToImplementThisException();
> });
>
> then I should be able to. Do you wish to argue that the java compiler
> should
> REFUSE to compile this code? If so - why? It's legal just about everywhere
> else. However, without resorting to target typing, which BGGA/CFJ aren't
> based on, the compiler cannot figure out that this closure returns 'int'.


Reinier-

The type Nothing plays no role in the process by which the language
determines that this code is legal in those specifications.

Cheers,
Neal



More information about the coin-dev mailing list