[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

RE>Signed/Unsigned confusio



Date: 13 Sep 90 16:36:08
   From: heh <xanadu!xanadu.com!heh>

	   Reply to:   RE>Signed/Unsigned confusion
   right.  oops.
     I can't look at the code right now, but I think the correct answer is to
   return either 0 (lastElemBefore) or the primarray count - 1 (firstElemAfter). 
   This should make the low water mark > the high water mark, which would mean
   that the table is empty.

But if the table is empty, then "primarray count - 1" will still be
negative (and hence a type violation).  Does Michael's suggestion
work?

   Date: Thu, 13 Sep 90 20:47:30 PDT
   From: xanadu!michael (Michael McClary)

   BLAST()

   Which is the generic answer to "How do I return an exception when every
   member of the set of possible return values is a valid non-exceptional
   result?"

   Magic numbers are for people who don't have an exception-handler.

I suspect not, as (on inspection of the code) the real question is:
what values should the instance variables take on?  (Although I like
Michael's answer in general for the kind of thing I originally thought
I was asking about.)  Any reason we don't use IntegerVars?

Btw, the *only* place either of the offending methods are called is
from "ActualIntegerTable::wipe.IntegerVar" (to mix language
notations).