Should you be able to initialize a float with a char?

matheus matheus at gmail.com
Thu May 19 16:42:58 UTC 2022


On Thursday, 19 May 2022 at 04:35:45 UTC, Walter Bright wrote:
> On 5/18/2022 5:47 PM, Steven Schveighoffer wrote:
>> But I have little hope for it, as Walter treats a boolean as 
>> an integer.
>
> They *are* integers.
> 

I always thought them as integers, yesterday I was adding some 
new features do addam_d_ruppes' IRC client and I did:

    auto pgdir = (ev.key == Keyboard.Key.PageDown)-(ev.key == 
KeyboardEvent.Key.PageUp);

So to get: -1, 0 or 1, and do the next action according the input 
given from the user.

Matheus.


More information about the Digitalmars-d mailing list