[Issue 2656] New: Require 0o format for octal literals
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 13 07:28:45 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2656
Summary: Require 0o format for octal literals
Product: D
Version: unspecified
Platform: PC
OS/Version: Windows
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: clugdbug at yahoo.com.au
D should follow Python's lead in removing the archaic, subtle, and unintuitive
format for octal literals. The obvious choices are of the form 0c45 and 0o45.
The key argument used for the "0o" format is here:
http://mail.python.org/pipermail/python-dev/2006-February/060351.html
and basically argues that since in printf(), "%o" is used for octal, whereas
"c" is used for char, "o" is the natural choice.
Buggy code like
a = 045;
is a very rare bug, but horribly difficult to identify.
Not a high priority, but it's the kind of C baggage which D has always aimed to
jettison.
--
More information about the Digitalmars-d-bugs
mailing list