| | @@ -52,7 +52,7 @@ |
| 52 | 52 | rotated (sections 6.1 and 6.8); it breaks no program. 2026-10.36 is a |
| 53 | 53 | twelfth: `MIN(T)` and `MAX(T)`, the limits of an integer type, and |
| 54 | 54 | `CLZ`, `CTZ` and `POPCOUNT`, which count bits (sections 6.1 and 6.8); |
| 55 | | -it breaks no program. |
| 55 | +and `INT(b)`, a `BOOL` as an integer (section 6.7); it breaks no program. |
| 56 | 56 | |
| 57 | 57 | The language is frozen, softly, from this version on: it changes only |
| 58 | 58 | to mend a defect, and its library grows only by what breaks no program |
| | @@ -939,18 +939,21 @@ |
| 939 | 939 | | `F64` | `F32` | the nearest `F32`; too big a value gives an infinity | |
| 940 | 940 | | enumeration | integer | its position | |
| 941 | 941 | | integer | enumeration | the name at that position; a position out of range is a failed check (6.5), and in a constant an error | |
| 942 | +| `BOOL` | integer | 0 for `false`, 1 for `true` | |
| 942 | 943 | | set | integer | its bits | |
| 943 | 944 | | integer | set | the low bits, as many as the set has | |
| 944 | 945 | | `INT`, `UINT` | pointer, procedure | the address | |
| 945 | 946 | | pointer, procedure | `INT`, `UINT` | the address | |
| 946 | 947 | | pointer, procedure | pointer, procedure | the same address, seen as the new type | |
| 947 | 948 | |
| 948 | | -There are no others: no conversion between `BOOL` and integers, none |
| 949 | | -between pointers and integers other than `INT` and `UINT`, and none to |
| 949 | +There are no others: none from an integer to `BOOL` (`x # 0` says it), |
| 950 | +none between pointers and integers other than `INT` and `UINT`, and none to |
| 950 | 951 | or from records, arrays, slices, variants or `ERROR`. An untyped integer constant converts to a pointer as an `INT` does, as |
| 951 | 952 | in `^VOLATILE U32(0FEE00000H)`; it isn't assigned to a pointer without |
| 952 | 953 | the conversion. A conversion of a constant is made by the compiler, by |
| 953 | | -the same rules: `U8(300)` is 44. |
| 954 | +the same rules: `U8(300)` is 44. `U64(a = b)` is 0 or 1, and |
| 955 | +`0 - U64(a = b)` is a mask; this is how a comparison is used with no |
| 956 | +`if`. |
| 954 | 957 | |
| 955 | 958 | ### 6.8 Built-in procedures |
| 956 | 959 | |