Discussion Thread: DIP 1035-- at system Variables--Community Review Round 2

Atila Neves atila.neves at gmail.com
Thu Mar 4 18:26:41 UTC 2021


On Wednesday, 3 March 2021 at 12:54:53 UTC, Dukc wrote:
> On Tuesday, 2 March 2021 at 20:46:17 UTC, Atila Neves wrote:
>> On Monday, 1 March 2021 at 21:26:18 UTC, Paul Backus wrote:
>>> On Monday, 1 March 2021 at 20:55:40 UTC, Atila Neves wrote:
>>>> On Thursday, 25 February 2021 at 09:21:20 UTC, Mike Parker 
>>>> wrote:
>>>>> This is the discussion thread for the second round of 
>>>>> Community Review of DIP 1035, "@system Variables":
>>>>>
>>>>> [...]

>
>> Slices (dynamic arrays) are slightly different because of the 
>> necessity of bounds checks.
>
> They are not. `(ubyte*).init[0xBAA..0xBEE]` is just as unsafe 
> as `cast(int*)0xDEADBEEF`, regardless of whether there are 
> bound checks when accessing it.

Yes, but not allowed in @safe code. My point is that @safe can 
still do:

auto arr = new int[7];
auto oops = arr[3_000_000];




More information about the Digitalmars-d mailing list