Closed xvxx closed 5 years ago
Yes, that would actually be very nice, as atm there's no way of removing a vector from memory (thus rendering every program into an executable memory leak). I guess there also should be a way to probe if an index exists ("has been initialized") on a vector or not, without actually accessing (and initializing) it.
http://kirste.userpage.fu-berlin.de/chemnet/use/info/gawk/gawk_12.html
You can find out if an element exists in an array at a certain index with the expression:
index in array
This expression tests whether or not the particular index exists, without the side effect of creating that element if it is not present. The expression has the value one (true) if array[index] exists, and zero (false) if it does not exist.
Something like this should be done in LDPL along with a way to empty vectors and delete particular indices.
What do you think about an
EMPTY VECTOR vec
command that clears the content of a vector?I am splitting apart string into vectors in a loop, and right now I'm clearing the vector by hand. Maybe that's okay though?