On Jun 26, 2012, at 4:40 PM, Steven Schveighoffer wrote:

> On Tue, 26 Jun 2012 19:10:25 -0400, bearophile <bearophileh...@lycos.com> 
> wrote:
> 
>> Steven Schveighoffer:
>> 
>>> I agree with Andrei, there is no outlet for errors in the to!T function, 
>>> exception is the logical choice.
>> 
>> Maybe I was not clear enough, so let me explain a bit better.
>> 
>> What I don't like is to!int("15\n") to be seen as an error in the first 
>> place.
>> I'd like it to ignore leading and trailing whitespace, as in Python 
>> (stripping it automatically):
> 
> Right, but what if it's an error in your code if whitespace is present?  Then 
> you have to check for whitespace and throw your own error.

to!int(trim("5\n"))

no?

Reply via email to