Writing / reading a common Lisp hash table (SBCL) or an alternative

I would like to write / read the hash table on / from the disk, but this is not a (print) . I won’t know the names of the keys, so I can’t think of a way to do this manually. I read that there can be specific distribution methods for this; Is there anything for this in SBCL?
I did not find anything in the SBCL manual or on Google.

If not, is there another way to store lists of integers bound to strings, be able to efficiently change these lists, and have a constant or at least faster than the available access time?
Are binary search trees light enough to implement with alists and is it a good idea to create a base database?

+6
source share
1 answer

MAPHASH displays a function with two arguments on a hash table for side effects. Two arguments are the key and value of each item in the hash table. You can use this, for example, to write each item in a hash table as a list of keys and values:

 (maphash (lambda (key value)(write (list key value))) *hash-table*) 
+11
source

Source: https://habr.com/ru/post/887330/


All Articles