On Tue, Oct 25, 2011 at 22:28, Sergey Didenko <[email protected]> wrote:
> I get the subject error when trying to deserialize a big map (70kb)
> using load-file.
>
> Is this by design?
>
> There was an advice in the old thread to "use smaller methods". But
> while small methods are good, breaking continuous data into smaller
> pieces looks like a hack.
>
> Should I use some other function for deserializing data?
>
> Currently I use pr-str to serialize and try load-file, load-string,
> eval read-string to deserialize.
>

load-file will compile what you've given it and then run the resulting
code. A data literal results in a method being emitted by the
compiler, which when run will produce the desired data structure. A
large data literal may cause the method to exceed the 64KB method size
limit of the class file format.

If it's really just data (not containing function or macro calls you
are expecting to be evaluated), just use (read ...). That will parse
the file, returning a Clojure data structure without evaluating it.

// ben

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to