I created one a while ago. https://github.com/jonghough/msgpack-j/blob/master/hashmap.ijs This is a crude implementation of a hashmap, using separate chaining. Admittedly, it isn't particularly great. E.g. hashing function implementation isnt very good. It uses symbols to represent inner hashmaps as a horrific workaround.
As Pascal said, maybe it is better to use a functional / J-esque approach. J oop has some serious limitations. E.g. there is no typeof function (that i am aware of), and object references are represented as boxed literals. . . So what do you do if your dictionary contains another dictionary, and boxed literals? There is no way to distinguish them. On the same topic, I wonder if anyone has implemented a good noncrypto hash function in J? E.g. murmurhash? Would be useful for implementing a hashmap. Regards, Jon On Apr 12, 2017, 21:34, at 21:34, Herbert Weissenbaeck // Privat <h...@herbertweissenbaeck.com> wrote: >Next beginner's question: What would be an efficient/fast (or the >recommended) J way to implement a dictionary with strings as keys and >arbitrary contents (nouns, verbs, boxes) as values, which allows >inserting, removing, fetching and editing? > >Thank you. > > > > >Sent from my iPhone >---------------------------------------------------------------------- >For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm