www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [your code here]

reply Menshikovk Konstantin <mensikovk17 gmail.com> writes:
I think it's cute and illustrates a lot of D's features at 
compile time.

void main()
{
   static if (__DATE__[0..6] == "Dec 08")
   {
     pragma(msg, "Happy Birthday to You");
     pragma(msg, "Happy Birthday to You");
     pragma(msg, "Happy Birthday Dlang");
     pragma(msg, "Happy Birthday to You\n");
     pragma(msg, "  D programming language is ",
       mixin(__DATE__[7..11]) - 2001, " years old!");
   }
}
Mar 26
next sibling parent Menshikovk Konstantin <mensikovk17 gmail.com> writes:
On Friday, 26 March 2021 at 18:31:46 UTC, Menshikovk Konstantin 
wrote:
some art.

void main()
{
   static if (__DATE__[0..6] == "Dec 08")
   {
     enum dlangAge = mixin(__DATE__[7..11]) - 2001;
     pragma(msg, "x-----------------------x");
     pragma(msg, "| Happy Birthday to You |");
     pragma(msg, "| Happy Birthday to You |");
     pragma(msg, "| Happy Birthday Dlang  |");
     pragma(msg, "| Happy Birthday to You |");
     pragma(msg, "x-----------------------x");
     pragma(msg, "D programming language is ", dlangAge, " years 
old!");
   }
}
Mar 26
prev sibling parent Ogi <ogion.art gmail.com> writes:
On Friday, 26 March 2021 at 18:31:46 UTC, Menshikovk Konstantin 
wrote:
 <...>
Hold my beer. ``` import std; static if (Date.fromSimpleString( format!"%s-%s-%02d"(__DATE__[7..11], __DATE__[0..3], mixin(__DATE__[4..6])) ).dayOfWeek == DayOfWeek.wed) { pragma(msg, "It's Wednesday my dudes"); } ``` Run with `dmd wednesday -o-`.
Apr 14