-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
Integer-to-boolean conversions treats 0 as false and all other bit-patterns as true
Why does it work this way, instead of doing trap_if(i >= 2) similar to what i32_to_char does?
(Aside: the names convert_int_to_bool and i32_to_char are a little inconsistent.)
Rust and many popular C and C++ ABIs use a convention of 0 meaning false and 1 meaning true, and could perform a no-op conversion of things like list<bool> into the source language if the Canonical ABI would guarantee that representation as well.
Metadata
Metadata
Assignees
Labels
No labels