[Issue 10717] New: std.ascii.toLower and toUpper should return char instead of dchar and avoid me to use a bad cast(char)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jul 26 05:06:15 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10717
Summary: std.ascii.toLower and toUpper should return char
instead of dchar and avoid me to use a bad cast(char)
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-07-26 05:06:14 PDT ---
If I use functions from std.ascii I am stating that I am working with ASCII
chars.
Also std.ascii docs say: "All of the functions in std.ascii accept unicode
characters but effectively ignore them."
So if I use std.ascii.toLower on an ASCII char, in most times (all times so
far) I want the result to be a char. If std.ascii.toLower returns a dchar it
forces me to use a cast(char) in most (or all) cases. Such cast doesn't
increase safety at all, it actually decreases it.
So I'd like std.ascii.toLower and std.ascii.toUpper to return char.
(This has a severity 'normal' instead of 'enhancement' because I regard that as
a bug in the design of those two functions.)
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list