13 lines
308 B
Mojo
13 lines
308 B
Mojo
# probe: does a Dict iterate in insertion order, and after a pop and re-insert?
|
|
def main() raises:
|
|
var d = Dict[Int, String]()
|
|
d[3] = "c"
|
|
d[1] = "a"
|
|
d[2] = "b"
|
|
for k in d.keys():
|
|
print(k)
|
|
_ = d.pop(1)
|
|
d[1] = "a again"
|
|
for e in d.items():
|
|
print(e.key, e.value)
|