tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make: new modifyer :Y



But if you wire them
> both down...
>
>   A = "Yes"
>   B = "yes"
>    ...
>   A == B
>
> suddenly the comparison is done as strings and becomes false, and the
> program logic fails

The above program does exactly what you say -- compare two *strings*.
This is DWIS. Neither A nor B should be implicitely converted to 1 or 0 here.
Values should be converted to 1 and 0 if and only if context requires it.
There are no such context in the above program.

> One of the goals/problems in language design is to sort out the
> evaluation and typing rules to prevent, or at least minimize, the
> existence of this kind of anomalous behavior.

See above.

> --
> David A. Holland
> dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index