[fpc-pascal] Array clearing
Michael Van Canneyt
michael at freepascal.org
Wed Apr 12 18:17:21 CEST 2017
On Wed, 12 Apr 2017, Ryan Joseph wrote:
>> On Apr 12, 2017, at 9:25 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
>> Adding a pop/push requires compiler magic, and could be implemented; but the question is whether it is worth it, given the plethora of other
>> options at your disposal.
> Why magic? It seems silly the operator += doesn’t exist or even a basic
> operation set like “add”, “remove”, “insert” that every array
> implementation in every language has. Aren’t those just function around
> the existing dynamic array implementation in the compiler?
That is why you need "the magic". The compiler needs to check the type, call
some helper routines etc.
More information about the fpc-pascal