# `gno.land/p/moul/x/daily/orderedmap/v0`
**Map that remembers insertion order** — `New`, `Set`, `Get`, `Has`, `Delete`,
`Keys`, `Values`, `Iterate`, `At`, `Clone`, `Len`, `MaxKeys`.
```go
import "gno.land/p/moul/x/daily/orderedmap/v0"
o := orderedmap.New()
o.Set("delta", "4"); o.Set("alpha", "1")
o.Keys() // ["delta" "alpha"] — insertion order, not sorted
o.Set("delta", "99") // updates in place, keeps position
```
**This matters more on chain than off it.** gno map iteration order is
unspecified, so a realm that ranges over a built-in map to build its `Render`
can emit a different page on every call — a **consensus bug**, not a cosmetic
one. This type gives back a deterministic order without requiring the keys to be
sortable.
Semantics worth knowing, each with a test:
- **Updating keeps position.** Insertion order means *first* insertion, not last
write.
- **Re-inserting after a delete goes last** — it is a new insertion.
- `Keys` returns a copy, so a caller cannot reorder the map through it.
Backed by a built-in map for O(1) `Get` plus a slice holding the order. `Delete`
is **O(n)**: closing the gap in that slice is what preserves order, and that
trade is stated rather than hidden. `MaxKeys` (4096) bounds growth; a full map
refuses new keys but still accepts updates to existing ones.
**Live demo:** [`r/moul/x/daily/orderedmapdemo`](https://github.com/moul/gno-contracts/tree/main/r/moul/x/daily/orderedmapdemo/v0)
· render it at [`/r/moul/x/daily/orderedmapdemo/v0`](https://gno.land/r/moul/x/daily/orderedmapdemo/v0).
<!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) -->
---
Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
> 🧪 **Highly experimental — potentially vibe-coded.** Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).
<!-- END GNOCONTRACTS FOOTER -->
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.