Why I'm Excited about D

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 7 13:11:29 PDT 2015


On Tue, Apr 07, 2015 at 04:46:07PM -0300, Ary Borenszweig via Digitalmars-d wrote:
> On 4/7/15 3:34 PM, deadalnix wrote:
> >On Tuesday, 7 April 2015 at 18:01:53 UTC, Ary Borenszweig wrote:
> >>On 4/7/15 2:16 PM, deadalnix wrote:
> >>>On Tuesday, 7 April 2015 at 08:58:57 UTC, ixid wrote:
> >>>>Or to be more consistent with UFCS:
> >>>>
> >>>>foreach (name; names.parallel) {
> >>>>   name.writeln;
> >>>>}
> >>>
> >>>no.please
> >>
> >>wat
> >
> >unreadable.is.ufcs.using.over
> 
> Yes, I don't like "writeln" being used with UFCS, it's an abuse.
> 
> My point is that every language has WATs :-)

My current favorite WAT in D is:

	import std.stdio;
	void fun(string text) {
		import std.conv;
		writeln(text);
	}
	void main() {
		fun("Hello world");
	}

This program outputs a blank line. :-)


T

-- 
A mathematician is a device for turning coffee into theorems. -- P. Erdos


More information about the Digitalmars-d mailing list