implicit address-taking for array slices
This commit is contained in:
@@ -144,6 +144,13 @@
|
||||
9. allow pointer field access pass-through (implemented)
|
||||
- having a pointer (`ptr`) to a struct, we should allow access through `ptr.field` as opposed to mandating `ptr^.field`
|
||||
|
||||
10. make slice expressions on array variables implicitly address-taking (implemented)
|
||||
- zig's slice expression on an array variable handles the address-taking implicitly (nice ergonomics)
|
||||
- `arr[a..b]` on an array variable now slices without the explicit `&`; the
|
||||
explicit `(&arr)[a..b]` pointer-to-array form keeps working unchanged
|
||||
- array rvalues (e.g. a by-value array return) are materialized into a
|
||||
temporary before slicing, matching the for-loop iterable lowering
|
||||
|
||||
## A word on multi-unwrap
|
||||
|
||||
Unwrap multiple optionals with `and`. This **short-circuits**: if the first optional is none, subsequent expressions are not evaluated.
|
||||
|
||||
Reference in New Issue
Block a user