[Issue 8713] Allow passing arguments to templates in CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 24 05:32:50 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8713



--- Comment #2 from jens.k.mueller at gmx.de 2012-09-24 05:33:43 PDT ---
(In reply to comment #1)
> What you are asking for is this:
> (a) things wrapped in if (__ctfe) don't get fully semantically checked when the
> function is compiled.
> (Specifically, anything which needs a compile-time value doesn't get checked
> for 'readable at compile time').
> 
> (b) CTFE functions never get compiled. When a template is encountered inside a
> CTFE function, it is created during execution of the function.
> 
> Your enhancement request acts as if (a) is the problem, but it isn't. (a) is an
> intentional restriction to protect us from (b) which is very, very nasty. It's
> not merely implementation issues (although they are formidable). Fundamentally
> it violates the independence of the compiler passes, which is crucial to the
> design of D (you always finish one pass before you start the next).

Why is the independence of compiler passes crucial to the design of D? What
would break if the compiler was implemented differently?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list