Visual D Debugger long array expansion indexing fix

Brett Brett at gmail.com
Sun Sep 22 08:34:40 UTC 2019


On Friday, 20 September 2019 at 07:27:51 UTC, Rainer Schuetze 
wrote:
>
>
> On 17/09/2019 22:04, Brett wrote:
>> On Tuesday, 17 September 2019 at 17:19:22 UTC, Brett wrote:
>>> On Tuesday, 17 September 2019 at 13:48:33 UTC, Brett wrote:
>>>> does things like [1000...2000]
>>>>
>>>> but then lists the values as [0], [1], ...
>>>>
>>>> Could it use the absolute values [1000], [1001], etc?
>>>>
>>>> That way one doesn't have to do mental arithmetic?
>>>>
>>>> Obviously not difficult but I see no reason to not do it.
>
> The nice thing about the current implementation is that there 
> is no extra state but the expression to be passed around by the 
> evaluation (a[1001] == a[1000..2000][1]), but I agree that it 
> is a bit confusing. Maybe there is some other solution...
>
>>>
>>> Also, can AA arrays have their keys sorted? Lexicographical 
>>> should work. I see no reason not to sort them, specially when 
>>> the keys are integers, helps locate values in large arrays 
>>> much easier.
>
> This can be a bit expensive for large arrays as all elements 
> need to be read and cached before displaying the first. This is 
> usually done incrementally by the debugger.
>

True. Could have a maximum setting, say, 1000 or 10000. Usually 
if the array is large one isn't going to look at it much anyways 
so the worst case is also the rarest.

>> 
>> And maybe add a linear index on AA's so it is easier to locate
>> values(and/or show length).
>> 
>
> This would be easier, but probably not so interesting if not 
> also sorted.

Right, but it helps with locating the index in a large array.. 
e.g., what is the 245th value. Well, now one has to count but if 
the index was next to it(or a mouse over could show it) then it 
would be instant.

It might not help in most cases though but in my particular case 
it helps since keys are indexes too.

It could be optional to show it and if sorting is added then it 
would just work hand and hand.



More information about the Digitalmars-d-debugger mailing list