D archeology

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Dec 20 17:20:42 PST 2013


On Sat, Dec 21, 2013 at 02:13:21AM +0100, Jakob Ovrum wrote:
[...]
> Anyway, I know for a fact that one can easily make DMD go into an
> infinite loop in various ways, so you'd have to implement some kind
> of timeout (not talking about CTFE here, which I think is
> self-limiting).

CTFE is self-limiting? Is there an internal timeout? I mean, what stops
one from doing something like:

	enum x = ctfeFunc();
	int ctfeFunc() {
		int i=1;
		while (i != 0)
		{
			i++;
			if (i > 5)
				i = 1;
		}
		return i;
	}

which would never terminate (neither will it consume memory or create
objects, so you have to solve the halting problem to know whether it
will terminate)?


T

-- 
Meat: euphemism for dead animal. -- Flora


More information about the Digitalmars-d mailing list