Time for Phobos CTFE-ability unittests...right? RIGHT?

Jonathan M Davis jmdavisProg at gmx.com
Tue Jul 12 18:05:13 PDT 2011


On 2011-07-12 17:16, Nick Sabalausky wrote:
> "Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message
> news:mailman.1576.1310513383.14074.digitalmars-d at puremagic.com...
> 
> > On 2011-07-12 16:17, Andrej Mitrovic wrote:
> >> I don't understand what strip() could be doing to break CTFE anyway?
> > 
> > Don has been making huge changes to CTFE. Stuff that didn't used to
> > compile,
> > now complie. Stuff which compiled but shouldn't have now doesn't compile.
> > There's probably stuff which used to compile and should still compile
> > which
> > doesn't compile now too. But with all of those changes, I'm not sure that
> > it's
> > at all reasonable to expect CTFE-ability to be stable. It should be
> > heading in
> > that direction, but I'm not sure how stable Don considers it. Certainly,
> > strip
> > could be failing for a perfectly legitimate reason, or it could be a bug.
> > I
> > have no idea. But with all of the changes that have been being made to
> > CTFE,
> > I'm not at all surprised if stuff has quit working. There's probably more
> > that
> > works now that didn't before, but with all of the recent changes,
> > breakage doesn't surprise me one bit.
> 
> I definitely expected that in 2.053, since that's the version that had the
> CTFE overhaul. But it's not being re-overhauled in each version after
> 2.053 - just bugfixes and added features. So at this point, I think it's
> reasonable to expect that any CTFE changes that break Phobos code should be
> fixed before release, even if only a temporary fix, in either the CTFE
> engine or in the Phobos code that was broken.

Well, regardless of whether CTFE is still having a major overhaul, there's 
still plenty of work being done on it. If you look at the changelog, you'll 
see that there are a lot of CTFE-related changes, and I know that more CTFE 
changes are in the works for 2.055 based on what Don has said. So, it doesn't 
surprise me at all that issues with it are cropping up. And unless Don is 
willing to say that we're going to guarantee the CTFEability of functions, 
then there will be no guarantees of any functions remaining CTFEable, and 
we're definitely not going to test that functions stay CTFEable.

If Don is willing to say that CTFE is stable enough to make guarantees about 
it and that we can make guarantees about Phobos functions being CTFEable, then 
I think that it makes perfect sense to add tests for it and make sure that 
functions remain CTFEable if they're currently CTFEable. But as long as Don is 
not willing to say that, then Phobos is not going to have any such guarantees 
and it makes no sense to test for CTFEability.

Ideally, I think that we would be able to make such guarantees and test for 
them, but Don has been against it, and he's the one managing CTFE at this 
point, so it's really up to him.

- Jonathan M Davis


More information about the Digitalmars-d mailing list