Thoughts on safe GC-less slices

Ben Jones fake at fake.fake
Wed Nov 17 04:12:22 UTC 2021


On Wednesday, 17 November 2021 at 03:45:03 UTC, Paul Backus wrote:
>
> Of course, you wouldn't normally do this, because it would be 
> very surprising to use the `foreach` keyword for something 
> other than iteration. But there is no *technical* reason you 
> couldn't.

Ah, gotcha.

I guess the more interesting question is how much breakage there 
would be if borrowedSlice variables were disallowed, and if 
distinguishing between owning and borrowed slices is possible 
without changing existing syntax too much.




More information about the Digitalmars-d mailing list