Re: NULLs: theoretical problems?
Date: Mon, 27 Aug 2007 15:13:49 -0000
On Aug 27, 12:58 am, Jan Hidders <hidd..._at_gmail.com> wrote:
> On 26 aug, 10:28, Jon Heggland <jon.heggl..._at_idi.ntnu.no> wrote:
> > But anyway: Can potential NULL-ness always be discovered statically?
> Not precisely. For example, for the part of SQL that corresponds to
> first-order logic that would be undecidable. But in practice you can
> come up with a set of rules that maybe strictly speaking too strict
> but still allows you comfortably to express everything.
This is exactly the classic tradeoff between statically typed and dynamically typed languages.
If I am not mistaken, it would be possible to produce a language in which every nullable expression can be detected, but some expressions could not be determined with static certainty one way or the other, and hence would have to be labeled nullable to preserve safety. That would include some expressions that could *never* be null but that cannot be proven never to be null.
Marshall Received on Mon Aug 27 2007 - 17:13:49 CEST