I’m trying to write large map into a file, and for some reason it doesn’t save the whole thing. It writes a map that ends with ellipsis like that {:key-n val-n, ...}. I tried switching from spit to doing this:
Yet that didn’t help. What am I missing? I mean the map is not that big, it actually contains less than 200 elements, but the keys are very long strings. Could that be some kind repl/nrepl/CIDER limitation?
Out of curiosity: why not just use spit and pr-str ?
pr-str will materialize a java.lang.String buffer containing the entire contents of the file eagerly. pr or prn however just streams writes to a writer, which lets you bypass the buffer and go “straight” to the disk. It’s just a memory/IO optimization that can be relevant for “lots” of data.