Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cheshire library not working for longer sequences #162

Open
prikshet opened this issue Mar 24, 2020 · 1 comment
Open

Cheshire library not working for longer sequences #162

prikshet opened this issue Mar 24, 2020 · 1 comment

Comments

@prikshet
Copy link

I have a sequence that contains more than 20 items, and I want to take 20 of those and convert them into json, so using Cheshire I do this:

(let [items (take 20 items-map)]

      (prn (cheshire/generate-string 
            items

            )

           )
      )

But this only works until take 10 or so, and after that there's no print at all. Why is this and what's the fix?

@dakrone
Copy link
Owner

dakrone commented Mar 26, 2020

Can you share the data you're using? For example, this works just fine with me:

user=> (use 'cheshire.core)
nil
user=> (def l [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20])
#'user/l
user=> (encode l)
"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]"
user=> (encode (take 20 l))
"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]"
user=> (encode (take 5 l))
"[1,2,3,4,5]"
user=> (encode (take 10 l))
"[1,2,3,4,5,6,7,8,9,10]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants