Dlist and dip1000 challenge

Steven Schveighoffer schveiguy at gmail.com
Tue Oct 23 20:46:26 UTC 2018


On 10/23/18 4:10 PM, Stanislav Blinov wrote:
> On Tuesday, 23 October 2018 at 19:03:25 UTC, Steven Schveighoffer wrote:
> 
>>> So, if "decomposition may continue transitively", it looks as if 
>>> there's no tail-scope for arrays, but then shouldn't it follow that for
>>>
>>> void foo(scope string[] args...);
>>>
>>> it should transitively slap `scope` into the immutable(char)* of each 
>>> argument?
>>
>> This is where I think there is going to be a problem. scope shouldn't 
>> be transitive, you can easily have a pointer allocated on the stack 
>> point to heap data.
> 
> Yeah, but OTOH, so can you have an array of pointers to the stack :\

This is where dip1000 actually makes sense -- the lifetime of that array 
should not outlive the stack. So, with dip1000 you *shouldn't* be able 
to have a heap array of pointers to the stack. Unless you circumvent via 
some specially written type.

-Steve


More information about the Digitalmars-d mailing list