www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2414] New: enum is dynamically evaluated, yum

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2414

           Summary: enum is dynamically evaluated, yum
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: andrei metalanguage.com


Just compile this, run it, and have a laugh:

import std.stdio;

void main() 
{
    double a = 1, b = 2;
    enum c = a + b;
    writeln(c);
    a = 2, b = 3;
    writeln(c);
}


-- 
Oct 12 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2414





------- Comment #1 from jarrett.billingsley gmail.com  2008-10-12 15:36 -------
It's a macro!  Weee!


-- 
Oct 12 2008
prev sibling parent Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
d-bugmail puremagic.com wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=2414
 
            Summary: enum is dynamically evaluated, yum
            Product: D
            Version: unspecified
           Platform: PC
         OS/Version: Linux
             Status: NEW
           Severity: normal
           Priority: P2
          Component: DMD
         AssignedTo: bugzilla digitalmars.com
         ReportedBy: andrei metalanguage.com
 
 
 Just compile this, run it, and have a laugh:
 
 import std.stdio;
 
 void main() 
 {
     double a = 1, b = 2;
     enum c = a + b;
     writeln(c);
     a = 2, b = 3;
     writeln(c);
 }
 
 

... :S -- Bruno Medeiros - Software Developer, MSc. in CS/E graduate http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Oct 17 2008