Re: feature proposal: expand associative arrays in lexicographic order o
From:
Koichi Murase
Subject:
Re: feature proposal: expand associative arrays in lexicographic order of keys
Date:
Tue, 1 Sep 2026 19:58:46 +0900
2026年8月26日(水) 4:35 Zachary Santer <zsanter@gmail.com>:
> "make loadables" failed for me, this morning.
If it is the same as Cygwin, you should be able to build the loadable builtin by
$ ./configure LDFLAGS='-Wl,--export-all-symbols,--out-implib,libbashdef.a'
$ make all
$ cd examples/loadables
$ make SHOBJ_LIBS=../../libbashdef.a asort
It should be noted that the generated loadable builtin only works
correctly with a Bash image built with "-Wl,--export-all-symbols".
$ ../../bash
$ enable -f ./asort asort
The loadable builtin asort seems to work in Cygwin. However, as I've
written in another reply, I'm not sure if a loadable builtin generated
this way would reliably work in an arbitrary case.
> > > So that linked list
>
> Or something more useful, like a red-black tree. Yes, I should
> actually look at the source code some time.
Balanced trees are slower than hash tables. I don't think it's worth
worsening the performance by switching the internal representation
just for a specific usage. Managing a separate linked list is even
worse, as it changes the time complexity. If an ordered map would be
implemented, it should be implemented as the third array type.
[Prev in Thread]
Current Thread
[Next in Thread]
Re: feature proposal: expand associative arrays in lexicographic order of keys,
Koichi Murase<=