Jump to page: 1 2
Thread overview
[Issue 16210] std.utf.byUTF can be made into a bidirectional range
Jul 26, 2016
Jack Stouffer
Dec 27, 2016
greenify
Mar 11, 2017
Jakub Łabaj
Mar 12, 2017
Jack Stouffer
Mar 13, 2017
Jakub Łabaj
Mar 13, 2017
Jakub Łabaj
Jul 25, 2021
Vlăduț Chicoș
Aug 01, 2021
Dlang Bot
Aug 01, 2021
Dlang Bot
Aug 06, 2021
Dlang Bot
July 26, 2016
https://issues.dlang.org/show_bug.cgi?id=16210

Jack Stouffer <jack@jackstouffer.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |16323

--
December 27, 2016
https://issues.dlang.org/show_bug.cgi?id=16210

greenify <greeenify@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |trivial
                 CC|                            |greeenify@gmail.com

--
January 20, 2017
https://issues.dlang.org/show_bug.cgi?id=16210
Issue 16210 depends on issue 16323, which changed state.

Issue 16323 Summary: std.utf.decodeBack https://issues.dlang.org/show_bug.cgi?id=16323

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
March 11, 2017
https://issues.dlang.org/show_bug.cgi?id=16210

Jakub Łabaj <uaaabbjjkl@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uaaabbjjkl@gmail.com

--- Comment #1 from Jakub Łabaj <uaaabbjjkl@gmail.com> ---
Assuming "ö" == [0xC3, 0xB6], which one version would be correct: a) behaviour of std.utf.byCodeUnit, just go by code units backward: "ö".byUTF!char().back == 0xB6

b) decode the character and return its first code unit:
"ö".byUTF!char().back == 0xC3

Personally I thought the b) version is desired (docs says that byUTF encodes input), but at the moment it passes some inputs to byCodeUnit - it means for some ranges byUTF is bidirectional already and version a) applies.

--
March 12, 2017
https://issues.dlang.org/show_bug.cgi?id=16210

--- Comment #2 from Jack Stouffer <jack@jackstouffer.com> ---
(In reply to Jakub Łabaj from comment #1)
> Assuming "ö" == [0xC3, 0xB6], which one version would be correct: a) behaviour of std.utf.byCodeUnit, just go by code units backward: "ö".byUTF!char().back == 0xB6
> 
> b) decode the character and return its first code unit:
> "ö".byUTF!char().back == 0xC3
> 
> Personally I thought the b) version is desired (docs says that byUTF encodes input), but at the moment it passes some inputs to byCodeUnit - it means for some ranges byUTF is bidirectional already and version a) applies.

Well damn. IMO B is more intuitive in all situations, so byUTF returning by byCodeUnit isn't want we really want.

But because we can't break code, we would have to have B be the behavior only when some encoding has to be done inside of byUTF and clearly document this odd behavior.

--
March 13, 2017
https://issues.dlang.org/show_bug.cgi?id=16210

--- Comment #3 from Jakub Łabaj <uaaabbjjkl@gmail.com> ---
Or we should implement another function e.g. byCodePoint which would behave as we want in all cases? For me it seems a better solution than function logic dependent on argument's type.

--
March 13, 2017
https://issues.dlang.org/show_bug.cgi?id=16210

--- Comment #4 from Jakub Łabaj <uaaabbjjkl@gmail.com> ---
Or maybe add a templated switch which would default to the a), but allow to
choose b)?

--
July 25, 2021
https://issues.dlang.org/show_bug.cgi?id=16210

Vlăduț Chicoș <vladut.chicos@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vladut.chicos@gmail.com
           Assignee|nobody@puremagic.com        |vladut.chicos@gmail.com

--
August 01, 2021
https://issues.dlang.org/show_bug.cgi?id=16210

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@vladchicos created dlang/phobos pull request #8183 "[DSSv3] Fix Issue 16210 - std.utf.byUTF can be made into a bidirectional range" fixing this issue:

- Fix Issue 16210 - std.utf.byUTF can be made into a bidirectional range.

https://github.com/dlang/phobos/pull/8183

--
August 01, 2021
https://issues.dlang.org/show_bug.cgi?id=16210

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
@vladchicos created dlang/phobos pull request #8185 "[DSSv3] Fix Issue 19727 - std.algorithm.endsWith fails to compile while startsWith succeeds" fixing this issue:

- Fix Issue 16210 - std.utf.byUTF can be made into a bidirectional range.

https://github.com/dlang/phobos/pull/8185

--
« First   ‹ Prev
1 2