"Try it now"

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Apr 14 07:24:53 PDT 2011


On 4/14/11 7:25 AM, spir wrote:
> On 04/14/2011 03:04 AM, Adam D. Ruppe wrote:
>> bearophile wrote:
>>> > This is a problem. Unittest code is not meant to produce an output,
>>> > while online snippets to try are meant to nearly always produce a
>>> > meaningful output.
>> I don't know - I like the approach Andrei took in the docs, writing
>> a series of true assertations.
>>
>> assert(sort([4, 2]) == [2, 4]);
>>
>> does look pretty neat. I guess the alternative is:
>>
>> writeln(sort[4, 2]); // prints "[2, 4]"
>
> What about
>
> // sort([4, 2]) == [2, 4])
>
> ? Looks to me both simpler & clearer.
>
> Denis

I don't like that one bit. What is it trying to achieve or improve?

Andrei


More information about the Digitalmars-d mailing list