No dictionaries?

Correct me if I’m wrong, but Mojo doesn’t have dictionaries yet, does it?
9 Replies
drunkwcodes
drunkwcodes2y ago
No, it doesn't. I'm waiting too.
ModularBot
ModularBot2y ago
Congrats @drunkwcodes, you just advanced to level 4!
Mahmoud Hussein
Mahmoud HusseinOP2y ago
Hopefully it will be soon.
lynet_101
lynet_1012y ago
The community is attempting to implement some, but it'll probbably be a few days and by the community i really mean me, and 2-3 other madlads Dictionary update: The dictionary is kinnda halted (ish) because, we don't have tuples, and we can't make tuples, cause we don't have traits. We're still trying to figure something out, but it may be a little while longer than just "a few days"
drunkwcodes
drunkwcodes2y ago
https://www.digitalocean.com/community/tutorials/hash-table-in-c-plus-plus Hash table seems not easy to implement, too. I appreciate your works.
How To Implement a Sample Hash Table in C/C++ | DigitalOcean
Technical tutorials, Q&A, events — This is an inclusive place where developers can find or lend support and discover new ways to contribute to the community.
bowlerman
bowlerman2y ago
What do you need tuples for that structs can't do? In strict type systems tuples are just anonymous structs with unnamed fields.
lynet_101
lynet_1012y ago
I mean, we could do it without struct, but still without traits, we can't implement the __EQ__ function (without using compiler arguments, which no one wants to do), and therefore we can't really scan through the dict and match a key to a val
supra
supra2y ago
When will list be support?
drunkwcodes
drunkwcodes2y ago
Please have a look at https://github.com/TeamPuzel/mojo-list and tell me what you think after trying, thanks.
GitHub
GitHub - TeamPuzel/mojo-list: A reference counted list supporting i...
A reference counted list supporting iteration, map, filter, fold and a lot more. - GitHub - TeamPuzel/mojo-list: A reference counted list supporting iteration, map, filter, fold and a lot more.

Did you find this page helpful?