On Thu, Jun 28, 2012 at 4:21 AM, kendeng9898 <
dolep...@gmail.com> wrote:
> Yes, it looks like a recursive map. But I hope the value canbe any
> type. like
string.int or something else.
>
> The use case is like a webserver
> we need to store session or application value. we don't know what the
> values type is. it look like this
>
>
> map["session"]["cookienumber001"]["username"]="sss"
> map["session"]["cookienumber001"]["age"]=14
FWIW, the way awk does "multi-dimensional associative array" is simply
to concatenate the string keys with a separator in between. So instead
of your first example, you could have e.g.
map["session:cookienumber001:username"] = "sss"
Use strings.Join to create the key then. Of course, this makes
deleting e.g. one cookie more difficult.
--Benny.