Proposed Enhancement: Deprecate std.conv.text With 0 Arguments
Steven Schveighoffer via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 23 06:05:45 PDT 2016
On 6/22/16 1:12 PM, Jack Stouffer wrote:
> On Wednesday, 22 June 2016 at 17:04:54 UTC, Meta wrote:
>> Intentional or not, I don't see any downside to disallowing calling
>> text with 0 args (aside from backwards-compatibility concerns). It
>> doesn't even return anything useful, just null.
>
> Well, the idea is that the function is a string constructor so it
> returns d/w/string.init with nothing passed in.
I think it's worthy of a change. if(something); used to be valid code.
But it's more likely to be an erroneous semi-colon. Making this an error
was a huge win.
Same thing with text with no args. You're actually better off using ""
or string.init.
-Steve
More information about the Digitalmars-d
mailing list