raz(7), the tutorial and CLAUDE.md for report 2026-10.31 The small types widening to INT and what an operator made not, an enumeration's name with its type, continue and the step before it; the readings the milestone took.
| @@ -230,6 +230,20 @@ | ||
| 230 | 230 | installed without `SA_RESTART`, so a call it breaks into is -4, which |
| 231 | 231 | `Out` and `Files` try again. Over C, `ready` and `readyFor` try `poll` |
| 232 | 232 | again after EINTR only when no signal `handle` took broke in. |
| 233 | +- `U8`, `I8` and `I16` widen to `INT`, `U8` and `U16` to `UINT`, one | |
| 234 | + step only (a `U8` into an `I64` is written), and not in `return f(x)` | |
| 235 | + (report 2026-10.31). An operator's result on them (`made`) doesn't | |
| 236 | + widen; a conversion's does, `U8(a + b)` too. | |
| 237 | +- An enumeration's name shared in its scope with another enumeration's | |
| 238 | + is written with its type; shared with anything else, the name alone is | |
| 239 | + that other declaration. A `match` arm on an enumeration takes the | |
| 240 | + type's names alone or with the type, which must be the matched one. | |
| 241 | +- `continue` is the last reserved word, so that the others keep the | |
| 242 | + seed's numbers; the seed's dumpers intern it first | |
| 243 | + (`src/test/seedcontinue.pas`). | |
| 244 | +- `Width` follows glibc's `wcwidth` but gives a control 0, and 0 to the | |
| 245 | + format characters glibc counts as 1 (Egyptian hieroglyph controls, | |
| 246 | + interlinear annotation), but for the prepended concatenation marks. | |
| 233 | 247 | - An `extern` module variable is read-only for an importer, as the |
| 234 | 248 | report says of every exported variable (3). |
| 235 | 249 | - Warnings come only for a module with no errors. A procedure naming |
| @@ -184,15 +184,32 @@ | ||
| 184 | 184 | Arithmetic wraps at the type's width, and never stops the program, |
| 185 | 185 | except dividing by zero. |
| 186 | 186 | .Pp |
| 187 | -Two types never mix but for one: | |
| 187 | +Two types never mix but where nothing can be lost: | |
| 188 | 188 | .Cm INT |
| 189 | -into | |
| 189 | +goes into | |
| 190 | 190 | .Cm I64 , |
| 191 | -which loses nothing, wherever the one meets the other, so with | |
| 191 | +wherever the one meets the other, so with | |
| 192 | 192 | .Cm "big: I64" , |
| 193 | 193 | .Cm "big + n" |
| 194 | 194 | is an |
| 195 | -.Cm I64 . | |
| 195 | +.Cm I64 ; | |
| 196 | +and | |
| 197 | +.Cm U8 , I8 | |
| 198 | +and | |
| 199 | +.Cm I16 , | |
| 200 | +which an | |
| 201 | +.Cm INT | |
| 202 | +holds on any machine, go into | |
| 203 | +.Cm INT , | |
| 204 | +so a digit's value is | |
| 205 | +.Cm "n := n * 10 + s[i] - '0'" . | |
| 206 | +What an operator made in a small type doesn't, since it may have | |
| 207 | +wrapped there: with | |
| 208 | +.Cm "a, b: U8" , | |
| 209 | +.Cm "n := a + b" | |
| 210 | +is an error, and | |
| 211 | +.Cm "INT(a) + b" | |
| 212 | +the sum. | |
| 196 | 213 | With |
| 197 | 214 | .Cm "c: I32" , |
| 198 | 215 | .Cm "c < n" |
| @@ -398,6 +415,19 @@ | ||
| 398 | 415 | empty slice, |
| 399 | 416 | .Cm "0 to LEN(s) - 1" |
| 400 | 417 | doesn't run at all. |
| 418 | +.Cm break | |
| 419 | +leaves a loop, and | |
| 420 | +.Cm continue | |
| 421 | +ends its round: a | |
| 422 | +.Cm for | |
| 423 | +steps, and a | |
| 424 | +.Cm while | |
| 425 | +tests again; so a | |
| 426 | +.Cm while | |
| 427 | +moves on, as | |
| 428 | +.Cm "i := i + n" , | |
| 429 | +before it can | |
| 430 | +.Cm continue . | |
| 401 | 431 | .Sh 6. RECORDS AND POINTERS |
| 402 | 432 | .Bd -literal -offset indent |
| 403 | 433 | module Boxes; |
| @@ -853,9 +883,11 @@ | ||
| 853 | 883 | when the program leaves the statements the |
| 854 | 884 | .Cm defer |
| 855 | 885 | stands in: at their end, or by a |
| 856 | -.Cm return | |
| 886 | +.Cm return , | |
| 887 | +a | |
| 888 | +.Cm break | |
| 857 | 889 | or a |
| 858 | -.Cm break . | |
| 890 | +.Cm continue . | |
| 859 | 891 | Deferred statements run the last first, and only those whose |
| 860 | 892 | .Cm defer |
| 861 | 893 | was reached. |
| @@ -980,7 +1012,11 @@ | ||
| 980 | 1012 | 01 |
| 981 | 1013 | .Ed |
| 982 | 1014 | .Pp |
| 983 | -An enumeration is a list of names, in order; a | |
| 1015 | +An enumeration is a list of names, in order, each of which may be | |
| 1016 | +written with its type, | |
| 1017 | +.Cm Color.red ; | |
| 1018 | +two enumerations may share a name, which is then always written so. | |
| 1019 | +A | |
| 984 | 1020 | .Cm "set of" |
| 985 | 1021 | it holds any choice of them, in the bits of a word, with |
| 986 | 1022 | .Cm in , |
| @@ -1219,7 +1255,8 @@ | ||
| 1219 | 1255 | .It "if (c) {...}" Ta "if c then begin" Ta "if c then ... end;" |
| 1220 | 1256 | .It "for (i=0; i<n; i++)" Ta "for i := 0 to n-1 do" Ta "for i := 0 to n - 1 do" |
| 1221 | 1257 | .It "switch (c)" Ta "case c of" Ta "match c of | 1: ..." |
| 1222 | -.It "continue, goto" Ta "goto" Ta "none: break only" | |
| 1258 | +.It "continue" Ta "continue" Ta "continue;" | |
| 1259 | +.It "goto" Ta "goto" Ta "none" | |
| 1223 | 1260 | .It "union" Ta "variant record" Ta "variant" |
| 1224 | 1261 | .It "struct p {...}" Ta "record ... end" Ta "record ... end" |
| 1225 | 1262 | .It "&x" Ta "@x" Ta "ADR(x)" |
| @@ -66,9 +66,9 @@ | ||
| 66 | 66 | The reserved words, all lowercase but |
| 67 | 67 | .Cm VOLATILE : |
| 68 | 68 | .Bd -literal -offset indent |
| 69 | -and begin break by code const defer div do else elsif end | |
| 70 | -extern for forward if import in link match mod module not of | |
| 71 | -or packed proc record repeat return set shl shr then to try | |
| 69 | +and begin break by code const continue defer div do else elsif | |
| 70 | +end extern for forward if import in link match mod module not | |
| 71 | +of or packed proc record repeat return set shl shr then to try | |
| 72 | 72 | type until var variant VOLATILE while xor |
| 73 | 73 | .Ed |
| 74 | 74 | .Pp |
| @@ -113,7 +113,7 @@ | ||
| 113 | 113 | | "for" Name ":=" Expr "to" Expr [ "by" Expr ] |
| 114 | 114 | "do" Stmts "end" |
| 115 | 115 | | "match" Expr "of" { "|" Arm } "end" |
| 116 | - | "return" [ Exprs ] | "break" | "defer" Stmt . | |
| 116 | + | "return" [ Exprs ] | "break" | "continue" | "defer" Stmt . | |
| 117 | 117 | Arm = ( Case [ "(" Names ")" ] | Label { "," Label } | "else" ) |
| 118 | 118 | ":" Stmts . |
| 119 | 119 | Stmts = { Stmt ";" } . |
| @@ -178,7 +178,7 @@ | ||
| 178 | 178 | .It Sy Type Ta Sy Size Ta Sy Values |
| 179 | 179 | .It "I8 I16 I32 I64" Ta "1, 2, 4, 8" Ta "signed, two's complement" |
| 180 | 180 | .It "U8 U16 U32 U64" Ta "1, 2, 4, 8" Ta "unsigned" |
| 181 | -.It "INT, UINT" Ta "8" Ta "as big as an address" | |
| 181 | +.It "INT, UINT" Ta "8" Ta "as big as an address, 16 bits at least" | |
| 182 | 182 | .It "BOOL" Ta "1" Ta "false, true" |
| 183 | 183 | .It "F32, F64" Ta "4, 8" Ta "IEEE 754" |
| 184 | 184 | .It "ERROR" Ta "8" Ta "nil, or a constant's error" |
| @@ -188,6 +188,11 @@ | ||
| 188 | 188 | .It "(a, b, c)" Ta "1" Ta "an enumeration, 256 names at most" |
| 189 | 189 | .It "set of E" Ta "1, 2, 4, 8" Ta "bit i for E's name i, 64 at most" |
| 190 | 190 | .El |
| 191 | +.Pp | |
| 192 | +An enumeration's name may be written with its type, | |
| 193 | +.Cm Color.red , | |
| 194 | +and must be where another declaration of its scope has the name too | |
| 195 | +[5.7]. | |
| 191 | 196 | .Bl -bullet |
| 192 | 197 | .It |
| 193 | 198 | A |
| @@ -246,7 +251,7 @@ | ||
| 246 | 251 | .Cm []U8 , ^U8 |
| 247 | 252 | (with a zero byte after it) or |
| 248 | 253 | .Cm [n]U8 , |
| 249 | -a procedure into its type, and | |
| 254 | +a procedure into its type, | |
| 250 | 255 | .Cm INT |
| 251 | 256 | into |
| 252 | 257 | .Cm I64 , |
| @@ -255,7 +260,24 @@ | ||
| 255 | 260 | .Cm U64 , |
| 256 | 261 | wherever it goes, results passed on whole and a |
| 257 | 262 | .Cm for Ns 's |
| 258 | -bounds too | |
| 263 | +bounds too, and | |
| 264 | +.Cm U8 , I8 | |
| 265 | +and | |
| 266 | +.Cm I16 | |
| 267 | +into | |
| 268 | +.Cm INT , | |
| 269 | +.Cm U8 | |
| 270 | +and | |
| 271 | +.Cm U16 | |
| 272 | +into | |
| 273 | +.Cm UINT , | |
| 274 | +in the same places but for results passed on whole, unless an | |
| 275 | +operator made them: with | |
| 276 | +.Cm "a, b: U8" , | |
| 277 | +.Cm "n := a + b" | |
| 278 | +is an error, and | |
| 279 | +.Cm "n := INT(a) + b" | |
| 280 | +is the sum | |
| 259 | 281 | [5.10]. |
| 260 | 282 | Anything else is converted by name. |
| 261 | 283 | .Sh OPERATORS |
| @@ -494,16 +516,26 @@ | ||
| 494 | 516 | .Cm while , repeat |
| 495 | 517 | or |
| 496 | 518 | .Cm for . |
| 519 | +.It Cm continue | |
| 520 | +To the end of the innermost loop's round: a | |
| 521 | +.Cm while | |
| 522 | +or a | |
| 523 | +.Cm repeat | |
| 524 | +tests again, a | |
| 525 | +.Cm for | |
| 526 | +steps; so a | |
| 527 | +.Cm while Ns 's | |
| 528 | +step comes before it. | |
| 497 | 529 | There is no |
| 498 | -.Cm goto | |
| 499 | -and no | |
| 500 | -.Cm continue . | |
| 530 | +.Cm goto . | |
| 501 | 531 | .It Cm defer |
| 502 | 532 | Runs its statement when the statements it stands in end, by their end, |
| 503 | 533 | a |
| 504 | -.Cm return | |
| 534 | +.Cm return , | |
| 535 | +a | |
| 536 | +.Cm break | |
| 505 | 537 | or a |
| 506 | -.Cm break ; | |
| 538 | +.Cm continue ; | |
| 507 | 539 | the last first. |
| 508 | 540 | .El |
| 509 | 541 | .Pp |