void main()
{
dchar d;
d = false;
d = true;
char c;
c = false;
c = true;
}
August 07, 2021 What is the value for D to allow assign bool to char/dchar? For me, it must be an error. | ||||
---|---|---|---|---|
| ||||
August 07, 2021 Re: What is the value for D to allow assign bool to char/dchar? For me, it must be an error. | ||||
---|---|---|---|---|
| ||||
Posted in reply to apz28 | On Saturday, 7 August 2021 at 21:45:09 UTC, apz28 wrote: >
true is 1 and false is 0. These are valid char and dchar values. Some people and languages are on board with this (like APL, quote: "Ken asked Wolfram why it was that in Mathematica propositions don’t have values 0 and 1 as in APL instead of True and False. Wolfram replied that he had no objections, but the Mathematica implementers were against it."), and some aren't.
|
Copyright © 1999-2021 by the D Language Foundation