Add Boolean method to interpret byte value as boolean?
Ty Young
youngty1997 at gmail.com
Thu Feb 20 13:56:28 UTC 2020
Hi,
Many functions use boolean values to determine whether or not an
operation succeeded(true) or failed(false). Project Panama does not
actually see booleans however and instead interprets them as byte
values(which is technically correct). This means that in order to convey
the correct type as defined in C, you would need to do your own check to
see if the value is 1.
There isn't, however, a standard method of doing this. Boolean only has
a function for getting a boolean from a string, not a byte. Given that
the need to convert a byte value to a boolean will be more common with
Project Panama it seems appropriate that one be added.
Could this be done?
More information about the panama-dev
mailing list