So, to print or not to print?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 25 13:29:59 PDT 2016


On 04/25/2016 04:18 PM, cym13 wrote:
> I dislike some points of the API though, I think changing eol is more
> common than changing separator so I would rather have the two switched.
> Maybe even removed, replaced by a single switch "eol=true" as contrary
> to python we have more powerful formating functions at hand and I think
> restricting the domain of each function would prove better on the long
> run in order to keep consistency.

I'd say it's a coin toss. There'd be as many arguments for one order as 
for the other.

> Also as the unittest shows it is hard to test a function that can only
> print to stdout which raises an orange flag in my mind: please, consider
> adding a way to supplant stdout. The best would be to make the unittest
> work:   file.print(i, i*i*i);  as it clearly comes from an natural
> expectation.

Good point to keep in mind, thanks.


Andrei



More information about the Digitalmars-d mailing list