www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Java updates

reply bearophile <bearophileHUGS lycos.com> writes:
Seeing how much D borrows from Java, I think you may be interested in seeing
some of the updates of Java:
http://hamletdarcy.blogspot.com/2008/12/java-7-update-from-mark-reinhold-at.html

Some of the most interesting changes:
- Safe rethrow - Allows a broad catch clause, with the compiler being smarter
on what you're allowed to rethrow based on what is thrown from the try block.
(I had not seen this before but it looks nice) (I don't understand how this can
be done).
- Null dereference expressions - Null checks with '?' syntax similar to
Groovy... lettign developers avoid a nest of null checks. (This will probably
come in D too, sooner or later).
- Compressed pointer 64 bit VM (This is very useful, but I think it's not easy
to do in 64-bit-D with pointers. References look more doable).

Bye,
bearophile
Dec 11 2008
next sibling parent Sean Kelly <sean invisibleduck.org> writes:
== Quote from bearophile (bearophileHUGS lycos.com)'s article
 - Compressed pointer 64 bit VM (This is very useful, but I think it's not easy
to do in 64-bit-D with
pointers. References look more doable). Compressed pointers would just have to be a new type. But it's more likely that we'd just create a struct for this in D, seeing as how we have opDot now. Sean
Dec 11 2008
prev sibling parent "Nick Sabalausky" <a a.a> writes:
"bearophile" <bearophileHUGS lycos.com> wrote in message 
news:ghrj09$205a$1 digitalmars.com...
 - Null dereference expressions - Null checks with '?' syntax similar to 
 Groovy... lettign developers avoid a nest of null checks. (This will 
 probably come in D too, sooner or later).
This is something Java desparately needs, as damn near everything in Java is nullable. I'm not sure I would argue against it in D, but I would say Java has much more of a need for it than D does. I was looking at the ANTLR/StringTemplate code a few weeks ago (it's written in Java) and there were so many null checks all over the place that I felt like I was looking at code from the time before exceptions replaced errors-as-return-values.
Dec 11 2008