@hyl \- you may be thinking of `adix/lptabz.nthKey` (or `nthPair`) in compact, 
insertion-ordered mode. (Maybe I should make that be `[]` for positional access 
and `{}` for keyed access, but this [seems 
unpopular](https://forum.nim-lang.org/t/6167#38125).)

That mode is active when sentinel type `Z` is `notin {K,void}`) for generic 
params `[K,V,Z;z:static[int]]`). I agree it could be documented better with 
more example code.

Araq did reply [not exactly 
unfavorably](https://forum.nim-lang.org/t/4966#31073) to having an API for this 
this in `std/tables.OrderedTable`. { His response was more just factual, but 
usually he is pretty up front if he thinks things are a terrible idea and 
should never happen. :-) So, it's a bit ambiguous. } The way the stdlib 
currently does ordered tables, it would be O(N) linked list hops to get the Nth 
element which could be very slow. The `adix/lptabz` method is a more efficient 
two level store.

All said, I have no idea if this is a good idea for the advent of code algo.

Reply via email to