Why Phobos is cool

tastyminerals tastyminerals at gmail.com
Thu Jul 16 18:41:42 UTC 2020


On Thursday, 9 July 2020 at 16:26:09 UTC, H. S. Teoh wrote:
> On Thu, Jul 09, 2020 at 03:58:19PM +0000, jmh530 via 
> Digitalmars-d wrote:
>> On Thursday, 9 July 2020 at 15:31:32 UTC, Petar Kirov 
>> [ZombineDev] wrote:
>> > On Tuesday, 7 July 2020 at 22:29:36 UTC, H. S. Teoh wrote:
>> > > [...]
>> > 
>> > dmd -run code.d | dmd -
>> 
>> So that compiles and runs code.d and then passes the result to 
>> dmd to build?
>
> Meaning, code.d generates D code that is run on the spot.
>
> Here's another one: the most powerful one-line D program that 
> ever existed and will ever exist. It can do literally anything 
> you tell it do, and best of all, it doesn't even take up that 
> much space.  In fact, it takes literally no disk space at all.  
> All you have to do is to run the following one-liner, and type 
> in what you want it to do as D code, and it will do it!  How 
> amazing is that???
>
> 	cat | dmd -run -
>
> :-P
>
>
> T

Without args cat reads from stdin and outputs to stdout which dmd 
-run - catches.
However, I typed writeln("hello D"); after the one-liner above, 
hit enter and nothing happened. Hit enter again, nothing.


More information about the Digitalmars-d mailing list