Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 26, 2017 Shortest quine in D | ||||
---|---|---|---|---|
| ||||
------hello.d:------ import std.stdio;void main(){write(import("hello.d"));} -------------------- Thanks to string imports, quines in D are actually trivial. :-D T -- Knowledge is that area of ignorance that we arrange and classify. -- Ambrose Bierce |
April 26, 2017 Re: Shortest quine in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | 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
|
April 27, 2017 Re: Shortest quine in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | 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 :) https://en.wikipedia.org/wiki/Quine_(computing)#.22Cheating.22_quines |
April 26, 2017 Re: Shortest quine in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | 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
|
Copyright © 1999-2021 by the D Language Foundation