[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Assertion !is_empty() failed - yet again
From: |
David Kastrup |
Subject: |
Re: Assertion !is_empty() failed - yet again |
Date: |
Fri, 01 Nov 2019 21:19:03 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Aaron Hill <address@hidden> writes:
> On 2019-10-30 2:05 am, Rutger Hofman wrote:
>> Sincere request: can this assert please be removed? Its validity
>> appears
>> debatable, and it is a showstopper for me!
>
> If we agree that an empty interval does not have a well-defined
> center, then the assertion is quite valid.
>
> But the problematic intervals in question were never intended to ever
> be empty, yet their left and right bounds are computed in such a way
> to form degenerate, "inside-out" intervals that are treated as empty.
> The assertion properly is pointing out this flaw in computation. As
> such, we should not be removing the assertion, because rather we
> should ensure that computations never invert the bounds of an
> interval.
>
> That said, I feel the hard-fail approach of an assertion is too
> strong, and what we need is to simply emit a warning that the function
> will be returning the midpoint of the interval's bounds despite the
> interval appearing to be invalid (read: empty).
There are lots of situations where this assertion may trigger and not
all of them may have a sensible fallback. So one would need to see what
particular case is triggered here.
--
David Kastrup
- Re: Assertion !is_empty() failed - yet again,
David Kastrup <=