So, I've got a weird one. What if I want to access the nth element of a hash table, much as one would with (nth myList)?
I know, I know, "why would you want to that that? A hash doesn't even have a guaranteed order!"
What I'm really trying to do is select a random element from a hash, and I want a more efficient way of doing it than iterating through each row 'till I reach my randomly-chosen index. So I want something like
I know, I know, "why would you want to that that? A hash doesn't even have a guaranteed order!"
What I'm really trying to do is select a random element from a hash, and I want a more efficient way of doing it than iterating through each row 'till I reach my randomly-chosen index. So I want something like
(hash-nth (random n) myHash)
Siggy