Circle Calculator Help
Steven Schveighoffer
schveiguy at yahoo.com
Tue Jun 26 15:13:32 PDT 2012
On Tue, 26 Jun 2012 17:17:29 -0400, bearophile <bearophileHUGS at lycos.com>
wrote:
> Steven Schveighoffer:
>
>> Oh, readln includes the newline by default, so to!float is choking on
>> that.
>
> Similar things happen often. But Andrei says this is good, because it's
> more orthogonal. As Sting, I don't subscribe to this point of view.
> Orthogonality isn't more important than practicality.
I agree with Andrei, there is no outlet for errors in the to!T function,
exception is the logical choice.
But I also agree with you that if you don't care, it should be possible to
ignore the errors without the cumbersome try-catch mechanism. Something
like:
to!(float, throw.No)(a)
or
toNoThrow!float(a)
-Steve
More information about the Digitalmars-d-learn
mailing list