[fpc-pascal] Feature announcement: Dynamic array extensions
Nitorami
mneubauer at alice-dsl.net
Sat Jun 2 08:35:17 CEST 2018
>Why are you using dynamic arrays for vectors/matricies? If what you have is
an actual array you wish to grow then + would likely be an append operation.
Dynamic arrays are incredibly convenient for purposes like signal processng,
whe you need to handle large blocks of numeric data in variable size. What
an annoyace that was in times of turbo pascal, when I had to fuff with
pointers, and use procedures for simple mathametical operations. With FPC
that was all gone, and I can now handle vectors the same as simple numbers.
Just like matlab does: a=bxc provides the expected result regardless whether
the variables are scalars, vectors or matrices.
I strongly disagree with the opionon that "+" is natural to be the append
operation. That may be true for strings, where it is the *only * useful
operator. But for numeric vectors, *all * mathematical operators +-*/ are
meaningful, and it is madness to steal one of them just for conatenation,
and to obliterate all other operators for use with dynamic arrays at the
same time. Obviously, if I cannot use "+", I can throw all others into the
bin as well, but rather think of a different concept using procedures, like
I am back in the 90s with turbo pascal.
By all means, please reconsider this, and leave me the choice to define the
operators. If I want "+" for concatting, it is trivial to define it myself.
I don't need the language to force that and eseentially destroy operator
overloading for mathematical operations on dynamic arrays.
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
More information about the fpc-pascal
mailing list