Shortest quine in D

Ali Çehreli via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 26 17:24:51 PDT 2017


On 04/26/2017 04:48 PM, Stefan Koch 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
>>
>>
>> T
>
> use __FILE__
> to make it a little more portable
>

Or a single letter source file to make it shorter. :p

Ali



More information about the Digitalmars-d mailing list