The philosophy of Nothing

Paul Benedict pbenedict at apache.org
Mon Nov 30 08:57:12 PST 2009


I am moving this discussion to closures-dev because that's where it
should have been from the beginning. The original thread is here:
http://mail.openjdk.java.net/pipermail/coin-dev/2009-November/002573.html

Neal,

Thanks for all your explanations thus far. What I am concerned about
is the simplicity of the language. I fear having three very similar
Java type for nothing is going to make the language confusing:
* java.lang.Void
* java.lang.Nothing
* null type

When I sit down and think about the need for java.lang.Nothing, I
can't answer why java.lang.Void isn't considered. That effectively is
nothing (a void). Couldn't that existing type fit the bill?

Given this example:
#() { throws AssertionError(); }

Couldn't the compiler infer java.lang.Void and prevent assignment?

Paul


More information about the closures-dev mailing list