Stack overflow

Jonathan M Davis jmdavisProg at gmx.com
Sat Jun 23 16:44:11 PDT 2012


On Saturday, June 23, 2012 07:27:56 Namespace wrote:
> I would prefer NullPointer Exceptions and / or not null types
> rather than playing around with the debugger.
> That's the first step.

NullPointerExceptions (well, they'd end up being NullPointersErrors) will 
_never_ happen. Walter is completely against them. From his point of view, the 
OS is _already_ checking this for you (hence the segfault or access 
violation), so there's no point in having the language check.

We might end up with something in druntime which prints out a stacktrace when 
a segfault occurs, but that's the closest that you'll ever get to a null 
pointer exception in D.

A non-nullable type _will_ be added to Phobos at some point. The issue is a 
matter of implementation. At least one has been submitted, but it wasn't good 
enough to be included as it stood. So, it hasn't been merged in. As soon as 
there is one which is good enough and has been appropriately reviewed by the 
Phobos devs, we'll have one. But until then, we don't.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list