Discussion:
byLine/byLineCopy deprecation?
bearophile via Digitalmars-d
2014-10-10 11:49:05 UTC
Permalink
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
ketmar via Digitalmars-d
2014-10-10 12:09:37 UTC
Permalink
On Fri, 10 Oct 2014 11:49:05 +0000
Post by bearophile via Digitalmars-d
A possible name for such function is "byRow!(bool doCopy=true,
.....)" and then slowly deprecate byLine and byLineCopy.
i think it should be better to use less generic type as template
argument. something like `byRow!Copying.Yes`. it's unnecessary annoying
to remember if `true` means "do copying" or "don't do copying". ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141010/9422fd3e/attachment.sig>
Loading...