Add bit operators, defer, list methods, rand, assert and rex test
- Bit operators & | ^ ~ << >> and their op= forms (Go precedence),
plus hex, binary and octal literals (0xff, 0b1010, 0o755)
- defer stmt / defer { ... }: runs when the block ends, last first,
also on return, ?, break and continue
- List methods insert, remove, clear, contains, index_of, reverse,
sort and sort_by (stable merge sort)
- rand module: int(a, b), float(), seed(n)
- assert(cond[, msg]) and `rex test`, which runs each test_ function
in its own process
- rex.toml marks a project's top folder: imports count from there
- Docs, formatter, LSP completions and editor grammars updated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
910bde692a
commit
300d767124
28 files changed
+1373
-65
No files matched your search
+2
-2
@@ -12,13 +12,13 @@ These notes teach it from zero. Read them in order, or jump to the
|
||||
| 1 | [First steps](01-first-steps.md) | Running a program, `print`, `main` |
|
||||
| 2 | [Values and types](02-values-and-types.md) | `var`, `const`, numbers, strings |
|
||||
| 3 | [Control flow](03-control-flow.md) | `if`, `for`, `match` |
|
||||
| 4 | [Functions](04-functions.md) | Parameters, results, closures |
|
||||
| 4 | [Functions](04-functions.md) | Parameters, results, closures, `defer` |
|
||||
| 5 | [Lists and maps](05-lists-and-maps.md) | Collections |
|
||||
| 6 | [Structs and enums](06-structs-and-enums.md) | Your own types, methods |
|
||||
| 7 | [Errors and nil](07-errors-and-nil.md) | `error`, `?`, `T?` |
|
||||
| 8 | [Memory](08-memory.md) | Copies, `shared`, `weak` |
|
||||
| 9 | [Generics and interfaces](09-generics-and-interfaces.md) | Code that works for many types |
|
||||
| 10 | [Files and the standard library](10-modules-and-stdlib.md) | `import`, `os`, `math`, `time` |
|
||||
| 10 | [Files and the standard library](10-modules-and-stdlib.md) | `import`, `os`, `math`, `time`, `rand`, tests |
|
||||
| 11 | [Cheatsheet](11-cheatsheet.md) | Everything on one page |
|
||||
| 12 | [A real program](12-calculator-walkthrough.md) | A calculator, split over five files |
|
||||
| 13 | [C and C++ libraries](13-c-libraries.md) | `import "raylib.h"`, your own C code |
|
||||
|
||||
Reference in new issue
Block a user