[Info-vax] DEC Basic and dynamic memory ?

Arne Vajhøj arne at vajhoej.dk
Sun Jan 30 19:09:34 EST 2022


On 1/30/2022 7:03 PM, Simon Clubley wrote:
> On 2022-01-30, Arne Vajhøj <arne at vajhoej.dk> wrote:
>>
>> It is actually not that different from the C/Pascal way.
>>
>> It just use array indexes instead of pointers/addresses.
>>
>> So 3 integers instead of 3 pointers.
>>
>> You can do tree's, hash tables's etc. that way.
>>
>> Just a different way of thinking.
> 
> Except you have to manage those integers yourself unlike the Pascal
> or C approach, especially if you want to prune or add nodes while you
> are processing the tree.

They get assigned when new nodes are added and they are used to
walk the tree. I don't think C/Pascal pointers would be different
in that regard.

Pascal pointers would be more type safe though.

>                            There's also the required copying of the
> current data every time you grow the tree.

That is common practice in many languages for dynamic
sized data structures needing linear backing.

Arne




More information about the Info-vax mailing list