[std-interval] interval(NaN)

George Corliss George.Corliss at marquette.edu
Sat Sep 16 09:13:59 PDT 2006


Guillaume,

Let me paraphrase to see if I understand.  What I hear you saying is that if
we (the interval community), after due consideration, are unable to decide
on the best way to handle a situation such as interval(double, NaN), that
situation should be considered an erroneous program.  The way a standard
specifies "erroneous" is "undefined."

I had not thought of "undefined" that way before.  I have thought of
"undefined" as a license for the implementer to do whatever she wants,
without even the obligation to tell me.  I have considered "undefined" as
weaker than "implementation-defined."

I have always tried to determine what I thought was the "safest" alternative
I could find and advising people not to get into that situation.  Does that
help explain why I have argued to avoid "undefined" in the standard?
However, you hold that by specifying the behavior is such questionable
situations, I am allowing, even encouraging people to use them.

You are asserting that "undefined" is STRONGER than "implementation-defined"
in the sense that "undefined" is intended to forbid use.  It is a big sign,
"DON'T GO THERE."  That certainly helps me understand why you have argued
FOR "undefined" situations.

Do you expect undefined situations to be flagged by compilers?  If so,
interval(NaN,NaN) requires a run-time check, and a run-time error message is
similar to raising an exception or logging.  Is it normal practice in
standard-writing that behavior in "undefined" cases is undefined, but we
hope that compilers will be as helpful in flagging them as they can
reasonably be?  Where "reasonable" is the choice of the compiler writer?

I think our end goal is the same: Programmers should not use such features,
either accidentally or intentionally.  I was trying to protect them if they
did; you are trying to prevent it in the first place.

Do I understand you correctly?  That's a change in perspective for me.  I
must think about it for a while.  I'm interested to hear other people's
reactions.

George




More information about the Std-interval mailing list