Thoughts on safe GC-less slices

Ben Jones fake at fake.fake
Wed Nov 17 02:08:44 UTC 2021


On Wednesday, 17 November 2021 at 01:33:46 UTC, Paul Backus wrote:
> This is basically the same lowering already provided by 
> [`opApply`][1]. The only differences are
>
> - `opApply` returns an integer code (used for control flow) 
> rather than the return value of the callback.
> - `opApply` uses the `foreach` keyword instead of `let`.
>
> [1]: https://dlang.org/spec/statement.html#foreach-statement

Good point, although `let` would allow you to do arbitrary 
indexing and sub-slicing with the borrowed as opposed to looping 
through the whole slice in order.



More information about the Digitalmars-d mailing list