Shortest quine in D

Nick Sabalausky (Abscissa) via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 26 21:36:10 PDT 2017


On 04/26/2017 11:37 PM, H. S. Teoh via Digitalmars-d wrote:
> On Thu, Apr 27, 2017 at 12:15:32AM +0000, Jon Degenhardt via Digitalmars-d wrote:
>> On Wednesday, 26 April 2017 at 23:19:32 UTC, H. S. Teoh wrote:
>>> ------hello.d:------
>>> import std.stdio;void main(){write(import("hello.d"));}
>>> --------------------
>>>
>>> Thanks to string imports, quines in D are actually trivial. :-D
>
> And on that note, an actual cheating quine for D would be the blank .d
> file: because compiling with dmd -main produces an executable that
> writes no output (i.e., output of length zero, identical to the source
> code).
>

Finally, our killer app!!! :)



More information about the Digitalmars-d mailing list