| | @@ -13,7 +13,7 @@ |
| 13 | 13 | This report defines the language. It is short on purpose. Whatever it |
| 14 | 14 | doesn't allow, raz doesn't have. |
| 15 | 15 | |
| 16 | | -This is version 2026-10.21 of the report; section 11 says where each |
| 16 | +This is version 2026-10.22 of the report; section 11 says where each |
| 17 | 17 | version's changes are told. 2026-10.11 and 2026-10.12 are a thaw the owner chose, |
| 18 | 18 | for a language anyone can build again. They break programs written |
| 19 | 19 | for 2026-10.10 and before: for 2026-10.9, say, the report of compiler |
| | @@ -50,7 +50,7 @@ |
| 50 | 50 | |
| 51 | 51 | A program is written in UTF-8. The compiler rejects a file that isn't |
| 52 | 52 | valid UTF-8: a malformed or overlong sequence, a surrogate, or a code |
| 53 | | -point beyond 10FFFFH. Everything outside strings, characters and |
| 53 | +point beyond 10FFFFH, and a file with a NUL byte. Everything outside strings, characters and |
| 54 | 54 | comments is ASCII. Spaces, tabs and line breaks separate symbols and |
| 55 | 55 | are otherwise ignored. |
| 56 | 56 | |
| | @@ -81,7 +81,8 @@ |
| 81 | 81 | all in capitals. `1.5` and `2.0E-3` are reals; a real always has a |
| 82 | 82 | digit on both sides of its point, and its exponent, if it has one, is |
| 83 | 83 | `E`, a sign if wanted, and digits. A decimal number above the largest |
| 84 | | -`I64`, or a hexadecimal one above the largest `U64`, is an error. |
| 84 | +`I64`, or a hexadecimal one above the largest `U64`, is an error; so is |
| 85 | +a real above the largest `F64`. A real below the least `F64` is 0. |
| 85 | 86 | |
| 86 | 87 | An integer is an untyped constant, which takes the type it is used as, |
| 87 | 88 | up to the largest `I64`. A hexadecimal number above that, such as |
| | @@ -103,7 +104,7 @@ |
| 103 | 104 | `"é"` is the two bytes 0C3H, 0A9H. Both characters and strings take the |
| 104 | 105 | escapes `\n` (line feed), `\t` (tab), `\r` (carriage return), `\0` |
| 105 | 106 | (zero), `\\`, `\'`, `\"`, `\u{H...}` (the code point with hexadecimal |
| 106 | | -value H..., in a string its UTF-8) and, in strings only, `\xHH` (the |
| 107 | +value H..., up to 10FFFFH, in a string its UTF-8) and, in strings only, `\xHH` (the |
| 107 | 108 | byte with hexadecimal value HH, which needn't make valid UTF-8). In |
| 108 | 109 | an escape, the hexadecimal digits may be capitals or not. A character |
| 109 | 110 | or a string ends on the line it starts on. |
| | @@ -759,7 +760,7 @@ |
| 759 | 760 | | `F32` | `F64` | the same value | |
| 760 | 761 | | `F64` | `F32` | the nearest `F32`; too big a value gives an infinity | |
| 761 | 762 | | enumeration | integer | its position | |
| 762 | | -| integer | enumeration | the name at that position; a position out of range is a failed check (6.5) | |
| 763 | +| integer | enumeration | the name at that position; a position out of range is a failed check (6.5), and in a constant an error | |
| 763 | 764 | | set | integer | its bits | |
| 764 | 765 | | integer | set | the low bits, as many as the set has | |
| 765 | 766 | | `INT`, `UINT` | pointer, procedure | the address | |
| | @@ -960,7 +961,9 @@ |
| 960 | 961 | program writes them. Copying a whole record or array through a |
| 961 | 962 | volatile pointer is not allowed, since it can't be one access. |
| 962 | 963 | |
| 963 | | -A `^VOLATILE T` doesn't convert to `^T` without a written conversion. |
| 964 | +A `^VOLATILE T` doesn't convert to `^T` without a written conversion, |
| 965 | +and a volatile variable isn't passed as a `var` argument, which would |
| 966 | +lose its volatility. |
| 964 | 967 | |
| 965 | 968 | `FENCE` also orders the program's ordinary accesses against those of |
| 966 | 969 | other processors and devices. |
| | @@ -1166,8 +1169,9 @@ |
| 1166 | 1169 | ``` |
| 1167 | 1170 | |
| 1168 | 1171 | **forward.** `proc f(x: I64): I64; forward;` declares `f` so that it |
| 1169 | | -can be called before its body appears; the body comes later with the |
| 1170 | | -same signature, though its parameters may have other names. |
| 1172 | +can be called before its body appears; the body comes later in the |
| 1173 | +module, with the same signature, though its parameters may have other |
| 1174 | +names; a `forward` with no body is an error. |
| 1171 | 1175 | |
| 1172 | 1176 | A name after a procedure's `end`, if written, is the procedure's own. |
| 1173 | 1177 | |
| | @@ -1323,7 +1327,11 @@ |
| 1323 | 1327 | say what is wrong and make no executable. Such a rule is one whose |
| 1324 | 1328 | breach would leave the program with no meaning this report can give: a |
| 1325 | 1329 | mistake of types, a name that isn't declared or is declared twice, an |
| 1326 | | -assignment to what is read-only, a module that imports itself. A fault |
| 1330 | +assignment to what is read-only, a call with the wrong number of |
| 1331 | +arguments, a type name or a procedure with no result used as a value, |
| 1332 | +type arguments given to a module that isn't generic, or too many, an |
| 1333 | +import that can't be found, a procedure declared `forward` and never |
| 1334 | +defined, a module that imports itself. A fault |
| 1327 | 1335 | that is only a lint isn't an error: a name declared and never used, or |
| 1328 | 1336 | a result that a call standing on its own drops (`Sys.write(fd, s);`, |
| 1329 | 1337 | where `_ := Sys.write(fd, s);` says it is meant). A program with one is |