dereferencing null

Jonathan M Davis jmdavisProg at gmx.com
Mon Mar 5 14:54:13 PST 2012


On Monday, March 05, 2012 15:05:57 Nick Sabalausky wrote:
> "Walter Bright" <newshound2 at digitalmars.com> wrote in message
> news:jiunst$qrm$1 at digitalmars.com...
> 
> > 3. Intercepting and recovering from seg faults, div by 0, etc., all sounds
> > great on paper. In practice, it is almost always wrong. The only exception
> > (!) to the rule is when sandboxing a plugin (as you suggested).
> 
> The purpose of catching exceptions is to respond to a condition. Recovery is
> merely *one* such type of response.

If a segfault were turned into an exception of some kind, then it would 
definitely need to be an Error like AssertError or OutOfMemoryError, not a type 
derived from Exception. And I'd argue that a NullPointerException should 
really be a NullPointerError if such is ever added.

- Jonathan M Davis


More information about the Digitalmars-d mailing list