What    |Removed                     |Added
                 CC|                            |

--- Comment #6 from 2011-11-15 15:07:25 PST ---
(In reply to comment #5)
> Currently this works, and ct_function() is run at compile-time because fixed
> array length definitions is a compile-time context, so in D it forces CTFE:
> int ct_function(int x) {
>     return x * 2;
> }
> void main() {
>     int[ct_function(5)] a;
> }
> If VLA come in D, and if their definition syntax is the same as the current
> fixed array definition syntax, then that length definition stops being a
> compile-time context, and the compiler is not forced (but free any way) to run
> ct_function() at compile-time.

It is not necessarily able to solve the particular halting problem instance.
The best that could be done without breaking backwards compatibility would be
to define the semantics of

int[foo()] a;

as either:

if foo() can be executed at compile time, take the result as the array length,
else either don't terminate compilation or introduce a VLA.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to