3 ms·
What makes it "special" here is the fact that it will COMPILE only on a friday. It's not a runtime error but a compile time error. Because yes otherwise I woul
by iLoveOncall 5y ago
What makes it "special" here is the fact that it will COMPILE only on a friday.
It's not a runtime error but a compile time error. Because yes otherwise I would agree that it's doable easily in every single language.
- ghayes 5y agoBut isn’t this possible with any language that has a pre-compilation step? Perl is certainly conflating its passes (as explained by other comments above), but in rust you could add a check in build.rs or use macros in C to accomplish the same, right?
- bachmeier 5y agoHere's a D program that only fails to compile if the last digit of the current number of seconds is 4: enum timestamp = __TIMESTAMP__; void main() { pragma(msg, timestamp[$-6..$-5]); auto a = 4; static if(timestamp[$-6..$-5] == "4") { auto a = 7; } }
- high_pathetic 5y agoIsn't perl an interpreted language? Or I am missing a point? What will happen when the command is `perl -c friday.pm`?
- jwilk 5y agoYou get the same output with "perl -c". (Actually I've just updated README to use that.) Note that the error message is "friday.pm had compilation errors, so yes, there's a compilation phase. It's not compiled to the machine code, though.