Hello, World!

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Mar 28 14:34:50 UTC 2022


On Mon, Mar 28, 2022 at 01:33:55PM +0000, Stanislav Blinov via Digitalmars-d wrote:
> On Monday, 28 March 2022 at 05:23:22 UTC, FeepingCreature wrote:
> 
> > Throwing my hat in the ring:
> > 
> > ```d
> > import std.stdio;
> > int main()
> >     => "Hello World".puts;
> > ```
> 
> Report failure in case of success? :) (`puts` returns a "non-negative
> value" on success, which, with that wording, is not necessarily 0).
> Cute though.

This should fix the return code:

	import std.stdio;
	int main() => !(1 + "Hello World".puts);

:-P (Well OK, this is a hack, EOF is not necessarily -1. But it is on my
system.)


T

-- 
The computer is only a tool. Unfortunately, so is the user. -- Armaphine, K5


More information about the Digitalmars-d mailing list