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


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugd...@yahoo.com.au
         Resolution|                            |INVALID


--- Comment #1 from Don <clugd...@yahoo.com.au> 2012-09-27 00:33:34 PDT ---
This if statement is a peculiar mix of compile-time and runtime conditions.
It should be rewritten as:

void f(S...)(S args) {
    static if (args[0].length>1) {
        if (args[0][1]>='0' && args[0][1]<='9') {
            printf("bla,%d\n",args[0][1]-'0');
        }
    }
}

The enhancement is basically a request for syntax sugar in these situations:
turn "if (false)" into "static if(false)". But it's very bug prone, eg this
program would compile:
------
void main(int argc)
{
   byte x = argc;
   if (x > 1000) {
       lets_confuse_the_maintenance_programmer() *= undefined_variable;
   }
}
-----
Will not be implemented.

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

Reply via email to