Ben Schulz wrote:

[...]
> Section 4.1 of the JLS disagrees with you, the null type is there, you
> just can't name it as part of a Java sentence. And it's a pity that
> it's so, but I understand the reasoning behind it (
> http://blogs.sun.com/abuckley/entry/naming_the_null_type ).
>   

As a sidenote: while I think a type system should be a lattice, the 
bottom type by itself is not sufficient (as stated in that blog post). 
The reason is that a lattice requires you to have exactly one largest 
common subtype for each type (and the dual), which can easily be broken 
by multiple inheritance:

interface X extends A,B
interface Y extends A,B

Assuming no other types in between, we have both X and Y as _a_ largest 
common subtype, but the uniqueness constraint is not fulfilled. It 
doesn't matter if there is a bottom or not, in fact the bottom element 
is usually derived as a feature of a complete lattice, not there by 
definition.

Having an explicit join would fix it, since (A & B) would be a subtype 
of A and B as well as a supertype of both X and Y and thus we got a 
Dedekind-McNeil completion into a lattice (X | Y would be the same in a 
closed world). If you don't have that defining the type of e.g. a 
parameter of a method that expects both A and B as interfaces would not 
be possible in a safe way.

With generics you can actually do that in Java, but not without.

Does that help fixing the mess with nulls? Probably not :-) I just like 
lattice theory as a conceptual modeling tool.

  Peter

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to