[Issue 3209] New: Please allow pure functions with input known at compile time to be executed at compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 25 04:24:58 PDT 2009


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

           Summary: Please allow pure functions with input known at
                    compile time to be executed at compile time
           Product: D
           Version: 2.031
          Platform: All
               URL: http://www.digitalmars.com/webnews/newsgroups.php?art_
                    group=digitalmars.D&article_id=93790
        OS/Version: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: asd at mailinator.com


Distinction between compile-time and run-time arguments is not intuitive when
the input is constant and function is pure:


pure bool isEmptyString(string str) {        
    static if (str == "") return true;
    return false;
}

void main()
{
    static if (isEmptyString(""))
    {
        pragma(msg,"works?");
    }
}

-- 
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