News for hackers. Stuff that matters.
Re:Exceptions (2003) by stormbrew on Sunday September 01, 2013 @08:51PM (#6312898)
I'm really fond of the idea of Nullable types (where you have to unwrap them by checking if they're null or errors to get the value). I don't think any non-functional language other than Rust has attempted to work this into the way they work yet, but it strikes me as a powerful mechanism that could also allow for deferring error handling to the site most capable of dealing with it.
Re:Exceptions (2003) by aaronbee on Sunday September 01, 2013 @11:17PM (#6313304)
Scala has the Try [0] and Either [1] types that can be used to achieve this. However, I believe Scala also allows any type to be NULL. In Rust there is no NULL so you don't have to worry if a value is ever NULL unless it is explicitly wrapped in an option instance.

[0] http://www.scala-lang.org/api/current/index.html#scala.util.... [1] http://www.scala-lang.org/api/current/index.html#scala.util....

Re:Exceptions (2003) by dack on Monday September 02, 2013 @01:42AM (#6313603)
If you use Guava, you even get Optional<T> for Java. It works pretty well, but is obviously something you have to work into your API and can't easily use after the fact.