[Issue 4165] std.conv.to!int doesn't ignore whitespace

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 22 14:24:22 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4165



--- Comment #1 from bearophile_hugs at eml.cc 2010-05-22 14:24:20 PDT ---
A comment by Adam Ruppe:
> I don't think that's a bug. It should only worry about converting, not
> filtering out bad stuff. That's an orthogonal problem that the other
> function does well, and easily too.

It's not a bug. But saying it's an orthogonal problem is not enough.

You must keep a balance between having a so flexible language/stdlib that's
sloppy and can lead to bugs, and to have as much orthogonal functions as
possible that are fussy and can lead to opposite kinds of bugs.

Often if I have to convert strings to numbers that have a leading newline.
Converting such string with leading newline to a number is not sloppiness
because my experience shows me it doesn't cause bugs in Python.

The way to!() is currently designed forces me to remove the spaces often. This
has caused a bug in one script-like D program.

-- 
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