Glenn Linderman <[EMAIL PROTECTED]> writes:
> Russ Allbery wrote:

>> I agree with Tom; I think it's pretty self-evident that they're the
>> same thing.  undef means exactly the same thing as null; that's not the
>> problem.  The problem is that Perl doesn't implement the tri-state
>> logic semantics that most users of null are used to, which is a
>> different issue.

> So, to paraphrase your statement a bit:

> It is self-evident that they're the same, the problem is that they work
> differently.

No, that's not a paraphrase.  That's saying something completely different
which is wrong.

If undef functioned differently than null, that would be a bug.  What's
missing is a way to say "I want tri-state logic" as a pragma.  When that
pragma is enabled, undef would be the null-like state.

Perl already has exactly the data value that you're looking for.  This RFC
is proposing to fix the wrong problem; the things that need to be changed
(conditionally) are the logical operators, not the data value.

> Nota Bene: IEEE floating point defines two different concepts that are
> not numbers, but can be mixed with numbers in expressions: Inf and NaN.
> And actually, there are positive and negative varieties of both Inf and
> NaN.  So I guess you might say that they are the same; but the problem
> is that they work differently.

There are positive and negative infinities, but that's a different
situation entirely; infinity is a degenerate value, not an undefined
value.  This is the first time I've ever heard of -NaN; are you sure about
that?  (There are, in fact, different types of NaN, such as signalling vs.
non-signalling, but that's due to floating point traps and exceptions,
issues that don't crop up in the situations where you want undef/null.)

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>

Reply via email to