digitalmars.D - [your code here]
- Menshikovk Konstantin (14/14) Mar 26 2021 I think it's cute and illustrates a lot of D's features at
- Menshikovk Konstantin (18/18) Mar 26 2021 On Friday, 26 March 2021 at 18:31:46 UTC, Menshikovk Konstantin
- Ogi (13/14) Apr 14 2021 Hold my beer.
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 2021
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 2021
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 2021