Re: So what's null then if it's not nothing?

From: vc <boston103_at_hotmail.com>
Date: 19 Dec 2005 05:25:57 -0800
Message-ID: <1134998757.235632.273440_at_z14g2000cwz.googlegroups.com>


Jon Heggland wrote:
> In article <1134991202.807776.49030_at_g14g2000cwa.googlegroups.com>,
> boston103_at_hotmail.com says...
> >
> > > "2 + NULL" is not a valid expression.
> >
> > So what is your expression interpreter is supposed to do when it
> > encounters expressions like that ? Throw an exception ?
>
> Yes. Say "Unknown symbol: 'NULL'" or something like it.

OK.

>
> > You are contradicting yourself, or your definition of 'valid' differs
> > from the usual one. If the null 'propagates', then the expression
> > '2+NULL' is agreeable to the expression evaluator (valid), in which
> > case the question stands, what is '+' in the expression ?
>
> No. "2 + NULL" is not a valid expression, but "2 + X", where X is an
> integer variable, is.

Do you mean to say that an error occurs whenever X is NULL in the '2 + X' expression ? If not, what is the result of such expression ?

> If IS_NULL(X) is TRUE, then so is IS_NULL(2 + X).

If '2 + X' evaluates to NULL, what does '+' mean in the expression ? How do you reconcile '2 + X' evaluating to NULL when X is NULL with '2 + NULL' throwing an exception ?

>

> > > Hopefully, endless discussions such as this one are avoided. As you
> > > might remember, the presence of null/w in a truth table was your
> > > principal argument against my interpretation of Codd.
> >
> > How do you avoid NULL presence in a truth table ?
>
> Um... By not putting it in there?

So what happens when you have an expression TRUE OR X and X happens to be NULL ?
Or something like (age < 30) or (occupation = 'student') where occupation happens to be NULL ? Would an exception be thrown, or would
the entire expression evaluate to NULL ?

Admittedly, it is easier if null
> propagates even in the face of "FALSE AND X" and "TRUE OR X". Which, by
> the way, there is precedent for in several programming languages: In
> Java, "true | booleanMethod()" does not necessarily evaluate to true.

For example ?

> --
> Jon
Received on Mon Dec 19 2005 - 14:25:57 CET

Original text of this message