By registering with us, you'll be able to discuss, share and exchange private messages with other members of our community.

SignUp Now!

Declined Associative arrays

Title text = "
Associative arrays
That's rather abstract. An example of what's actually desired would be in order. Do you mean (simply) a one-dimensional array indexed by arbitrary strings, with addition, deletion, lookup, and modification capabilities? Really ... does anyone have something concrete in mind? How about ...

aarray streetnums
aarray /add streetnums "Vince" "1067"
echo Vince's street number is %streetnums["Vince"]

That's pretty simple-minded. On the surface, it doesn't allow iteration over the existing indices (which might be desirable).

I have seen the STL's "map" class mentioned in connection with such things.
Oh come on! You know you've got that DWIM parser right there, waiting in the wings! :-P

(gotcha, I saw the light after reading Vince's reply)