<div dir="ltr"><div dir="ltr">On Fri, Oct 21, 2022 at 5:45 AM Deadmarshal <<a href="mailto:adeadmarshal@gmail.com">adeadmarshal@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div>I was also wondering if a realloc() function similar to C can be made in Oberon? Because it can be used to create dynamic arrays much like the CPP's std::vector. I am well aware that I could use a linked list for that purpose, but I'm curious about dynamic arrays. </div></div></blockquote><div> </div><div>A similar capability has been implemented in Gardens Point Component Pascal (i.e. Oberon-2+ for .NET and JVM). Refer to Section 4.6 "Extensible arrays: the vector type" in the release notes:</div><div><br></div><div>"Values of these vector types are dynamically allocated, and automatically extend their capacity when an append operation is performed on an array that is already full. Vectors may be<br>declared to have any element type, and extend their length using amortized doubling. In most circumstances when a linked list would otherwise have been used the vector<br>types are faster, more memory efficient, and allow memory-safe indexing. Elements of vectors may be accessed using the familiar index syntax, with index values checked against the active length of the array, rather than the array capacity."<br></div><div><br></div><div><a href="https://github.com/k-john-gough/gpcp/releases">https://github.com/k-john-gough/gpcp/releases</a></div><div><br></div><div>Full source code is available if you want to see how you might implement a similar extension in your preferred Oberon system. </div><div><br></div><div>Regards,</div><div>Chris Burrows</div><div>CFB Software</div><div><a href="https://www.astrobe.com">https://www.astrobe.com</a></div><div><br></div><div> </div></div></div>