| | @@ -9,7 +9,7 @@ |
| 9 | 9 | This report defines the language. It is short on purpose. Whatever it |
| 10 | 10 | doesn't allow, raz doesn't have. |
| 11 | 11 | |
| 12 | | -This is version 2026-10.16 of the report; section 12 says what each |
| 12 | +This is version 2026-10.17 of the report; section 12 says what each |
| 13 | 13 | version changed. 2026-10.11 and 2026-10.12 are a thaw the owner chose, |
| 14 | 14 | for a language anyone can build again. They break programs written |
| 15 | 15 | for 2026-10.10 and before: for 2026-10.9, say, the report of compiler |
| | @@ -768,6 +768,7 @@ |
| 768 | 768 | | `LEN(a)` | the number of elements of an array or a string constant (an untyped constant) or of a slice (an `INT`) | |
| 769 | 769 | | `NEW(p, a)` | sets `p: ^T` to a fresh, zeroed `T` from the allocator `a: ^Mem.Allocator`, or to `nil` if `a` has no room | |
| 770 | 770 | | `MSG(e)` | the message of the error `e`, a `[]U8` | |
| 771 | +| `COPY(d, s)` | copies the elements of `s` to the start of `d`, both arrays or slices of one type `T`; `LEN(s)` must be at most `LEN(d)` | |
| 771 | 772 | | `SYSCALL(n, x1, ..., x6)` | Linux system call `n` with up to six arguments, each a pointer or an integer no wider than `INT`; the raw result, an `INT` (a negative number is `-errno`) | |
| 772 | 773 | | `INC(v)`, `INC(v, k)` | adds 1, or `k`, to the integer variable `v`; it wraps, like `+` | |
| 773 | 774 | | `DEC(v)`, `DEC(v, k)` | subtracts 1, or `k`, from `v` | |
| | @@ -787,6 +788,12 @@ |
| 787 | 788 | `Mem.Allocator` (section 11) is the one type of the library the |
| 788 | 789 | language names. |
| 789 | 790 | |
| 791 | +`COPY` is a statement, as `INC` is. It copies the bytes of `LEN(s)` |
| 792 | +elements as one block, as an assignment of an array does, and is right |
| 793 | +when `d` and `s` overlap, as in `COPY(a[1..n], a[0..n - 1])`. It is |
| 794 | +checked as a slice is: past `LEN(d)`, it stops the program, unless the |
| 795 | +module says `check off;`. |
| 796 | + |
| 790 | 797 | `INC` and `DEC` evaluate `v` once, so `INC(a[f(i)])` calls `f` once. They |
| 791 | 798 | read `v` and then write it: two accesses, even through a `^VOLATILE` |
| 792 | 799 | pointer, and not atomic; `XADD` is the atomic one. |
| | @@ -1916,6 +1923,8 @@ |
| 1916 | 1923 | - **2026-10.16.** Record constants, and array and record constants of |
| 1917 | 1924 | records, strings, procedures and more (section 4); `Str` gains |
| 1918 | 1925 | `copy` (section 11). |
| 1926 | +- **2026-10.17.** `COPY` copies the elements of one array or slice to |
| 1927 | + another as a block (section 6.8). |
| 1919 | 1928 | |
| 1920 | 1929 | ## Appendix A. What an implementation chooses |
| 1921 | 1930 | |