byLine/byLineCopy deprecation?

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 10 04:49:05 PDT 2014


I have had few bugs caused by byLine not copying the line on 
default. Now we have byLineCopy, but sometimes I forget to use 
it. In D I prefer unsafe functions to be on request, and safe 
ones by default.

Originally I suggested to give to byLine a boolean template 
argument named "doCopy" that is true on default and can be set to 
false for performance:

https://d.puremagic.com/issues/show_bug.cgi?id=4474

So can we deprecate byLine and introduce something with a short 
name that is safer and something with a longer name that is 
faster (or probably better use just one function with the doCopy 
boolean template argument set to true by default).

A possible name for such function is "byRow!(bool doCopy=true, 
.....)" and then slowly deprecate byLine and byLineCopy.

Bye,
bearophile


More information about the Digitalmars-d mailing list