3 ms·
Some fun I had with free pascal in college was that you can $DEFINE almost anything to almost anything else: {$DEFINE (:=ab} {$DEFINE ):=ba} ...etc... C
by SmallDeadGuy 9y ago
Some fun I had with free pascal in college was that you can $DEFINE almost anything to almost anything else:
{$DEFINE (:=ab}
{$DEFINE ):=ba}
...etc...
Code becomes pretty ridiculous:
WriteLn ab ab a + b ba * c ba
If you define WriteLn, +, and * as other things too you can get horrific looking code. All keywords like program, if, then, and end can be redefined. I wrote a script that would take a regular source file and output a functionally identical file which looked like:
{$DEFINE program:=a}
... many more defines ...
{$DEFINE [:=zd}
{$DEFINE ]:=ze}
a b c d e f g h (* ... the entire program on one obfuscated line *)
- thanatropism 9y agoTCL is arguably more extreme in this matter.
- boznz 9y agoWow, using pascal for 30 years and diddnt know this.. I am actually thankful its not that well known. Pascal is still readable where as #defines in C libraries give me terrible headaches decoding.