问题
I am trying to serialize some lists in clojure using pr-str, but any list with over 100 elements is getting cut off. Example:
(pr-str (repeat 200 [2]))
yields
"([2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] ...)"
回答1:
Presumably you have *print-length*
bound to 100. To lift the limit, reset it to nil
:
(set! *print-length* nil)
As for where it could be bound / set in the first place, that depends on your setup. For Leiningen, both user-level and project-level settings are relevant (so have a look in ~/.lein/profiles.clj
and in project.clj
).
来源:https://stackoverflow.com/questions/20300594/clojure-pr-str-cutting-off-lists-100-items