digitalmars.D.bugs - [Issue 10662] New: byLine!(Char, immutable Char) won't compile in git master
- d-bugmail puremagic.com (19/19) Jul 17 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10662
- d-bugmail puremagic.com (10/10) Jul 17 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10662
- d-bugmail puremagic.com (22/22) Jul 17 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10662
- d-bugmail puremagic.com (9/26) Jul 17 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10662
- d-bugmail puremagic.com (7/10) Jul 17 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10662
- d-bugmail puremagic.com (14/20) Jul 17 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10662
- d-bugmail puremagic.com (16/20) Jul 18 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10662
http://d.puremagic.com/issues/show_bug.cgi?id=10662 Summary: byLine!(Char, immutable Char) won't compile in git master Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: ntrel-public yahoo.co.uk 04:59:51 PDT --- This won't compile because readln(buf) now requires a mutable buf. I have a fix ready to submit presently. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 17 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10662 Nick Treleaven <ntrel-public yahoo.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull, rejects-valid 05:16:54 PDT --- https://github.com/D-Programming-Language/phobos/pull/1418 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 17 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10662 monarchdodra gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |monarchdodra gmail.com I question whether or not this is a "rejects valid": byLine explicitly states buffer re-use, so requesting a `ByLine!(immutable Char)` simply is not possible. That said, I *would* see this as an enhancement, to have a line reader that always returns brand new buffers (in which case the line may or may not be immutable). EG: By ByDupLine ? Either that, or we simply keep using `byLine().map!"a.dup"` and `byLine().map!"a.idup"` That said, a `byDupLine` *is* a bit more user friendly, and helps limit levels of complexity in user code, as well as limits dependency on algorithm. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 17 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10662I question whether or not this is a "rejects valid": byLine explicitly states buffer re-use, so requesting a `ByLine!(immutable Char)` simply is not possible. That said, I *would* see this as an enhancement, to have a line reader that always returns brand new buffers (in which case the line may or may not be immutable). EG: By ByDupLine ? Either that, or we simply keep using `byLine().map!"a.dup"` and `byLine().map!"a.idup"` That said, a `byDupLine` *is* a bit more user friendly, and helps limit levels of complexity in user code, as well as limits dependency on algorithm.In defense of the "ByDupLine" argument, one *BIG* advantage it can provide is that it can guarantee a single dup per front. `byLine().map!"a.dup`, on the other hand will call dup on every call to front. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 17 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10662 09:48:23 PDT ---I question whether or not this is a "rejects valid": byLine explicitly states buffer re-use, so requesting a `ByLine!(immutable Char)` simply is not possible.Where does byLine state that? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 17 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10662Hum... I guess it doesn't actually state it (my bad). But even if un-documented, it is the "de facto" behavior, and the subject of countless threads on the boards. If (*if*) we accept that ByLine is designed as a range wrapper to "readln(_front)", then we should take into account that readln *does* document buffer re-use... That's my take on it anyways. I think adding support for this adds little value (IMO), and can only be exploited with a hard to use syntax. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------I question whether or not this is a "rejects valid": byLine explicitly states buffer re-use, so requesting a `ByLine!(immutable Char)` simply is not possible.Where does byLine state that?
Jul 17 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10662 Nick Treleaven <ntrel-public yahoo.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rejects-valid | 08:08:27 PDT ---I question whether or not this is a "rejects valid"I suppose it's arguable, so I've now removed the rejects-valid keyword. (I think it did work before the readln(buf) change though).That said, I *would* see this as an enhancement, to have a line reader that always returns brand new buffers (in which case the line may or may not be immutable).I have some ideas about other solutions, I will post something to the NG next week. I can't see how fixing this bug would be undesirable, but I agree byLine!(char, immutable char) is awkward syntax (I have an idea how to improve it). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 18 2013