Arc Forumnew | comments | leaders | submitlogin
2 points by akkartik 1914 days ago | link | parent

That Wikipedia page seems to only talk about C++. I just checked and C++'s `map` doesn't support indexing by integer: http://www.cplusplus.com/reference/map/map.

So I don't think this is something anybody supports:

  arc> (= grail (otable a "up" b "down"))
  arc> grail.0
  "up"
Ordered associative containers merely have a well-defined order for iterating over. And the order has nothing to do with the order in which elements were inserted.

So what you're asking for is interesting and plausible, but I don't think "ordered tables" is quite the precise label for it.



2 points by kinnard 1914 days ago | link

Damn. I thought I might've gotten that mixed up. Should've checked.

I think clojure's array-maps do it but with some limitations:

https://clojure.org/reference/data_structures#ArrayMaps

http://arclanguage.org/item?id=21014

-----