Associative arrays

#4
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 ...

Code:
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.
 
Jan 19, 2011
581
10
Norman, OK
#6
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)