unsigned policy (implicit conversions for complex?)
Andrei Alexandrescu (See Website For Email)
SeeWebsiteForEmail at erdani.org
Mon Feb 12 19:06:25 PST 2007
Walter Bright wrote:
> Derek Parnell wrote:
>> On Mon, 12 Feb 2007 16:03:14 -0800, Andrei Alexandrescu (See Website For
>> Email) wrote:
>>
>>> http://erdani.org/d-implicit-conversions.pdf
>>
>>> Did I forget something?
>>
>> Characters are not numbers.
>
> That's an enticing point of view, and it sounds good. But Pascal has
> that view, and my experience with it is it's one of the reasons Pascal
> sucks.
>
> Examples:
>
> 1) converting text <=> integers
> 2) converting case
> 3) doing compression/encryption code
> 4) using characters as indices (isspace() for example)
>
> Take away the implicit conversions, and such code gets littered with
> ugly casts.
Ionno. Probably instead of dealing with data as a stream/string of
characters, you handle it as integers, and that's just one cast. Pascal
didn't offer you that.
How about the infamous automatic bool -> int conversion? Now that's a
sucker that caused a ton of harm to C++.
Andrei
More information about the Digitalmars-d
mailing list