[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]
- To: <heh@xxxxxxxxxxx>
- Subject: RE>Signed/Unsigned confusio
- From: Mark S. Miller <vlad!mark>
- Date: Fri, 14 Sep 90 00:59:36 PDT
- Cc: <michael@xxxxxxxxxxx>, <xtech@xxxxxxxxxxx>
- In-reply-to: 08 <9009132331.AA26997@xanadu>
Date: 13 Sep 90 16:36:08
From: heh <xanadu!xanadu.com!heh>
Reply to: RE>Signed/Unsigned confusion
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
Date: Thu, 13 Sep 90 20:47:30 PDT
From: xanadu!michael (Michael McClary)
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
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