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

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4165

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|future  |D2

--


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

2010-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4165


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||dsim...@yahoo.com
 Resolution||WONTFIX


--- Comment #3 from David Simcha dsim...@yahoo.com 2010-08-15 08:10:52 PDT ---
I'm marking this as wontfix because it's by design (it's mentioned in the docs
of std.conv), and there's a trivial workaround:

int x = to!int( 0123\n.strip());

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


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

2010-08-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4165


Lars T. Kyllingstad bugzi...@kyllingen.net changed:

   What|Removed |Added

 CC||bugzi...@kyllingen.net
   Severity|normal  |enhancement


--- Comment #2 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-08-13 
03:27:02 PDT ---
Since we all agree this is not a bug, I'm marking it as an enhancement request.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


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

2010-05-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4165



--- Comment #1 from bearophile_h...@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: ---