Force realization

Hey,

I have coded quite a lot with Clojure already but I can’t get forced realization of a lazy seq to work. I already do this:

blocks (doall (into (group-subroutine-decs subroutine-dec-code)))

Sometimes, into forces the realization and I can easily debug my code. Sometimes doall does the trick (as the ClojureDocs say). In this case, nothing works. I can’t really debug the code because the value simply isn’t realised (IntelliJ).

Is there any trick I can use? I’d appreciate some help here

Both of them realize the seq, into [] also changes the type to a vector.

In this case, nothing works. I can’t really debug the code because the value simply isn’t realised (IntelliJ).

What are the actual symptoms? What makes you think that whatever you’re seeing is due to collection realization and not something else?

Well, I can’t really debug the code because I cannot see the value because it is not realised yet…

You just repeated the OP without any details.

What exactly do you see? Can you share a screenshot?
What makes you think that values aren’t realized?
Can you create a small reproducible example?

Here’s what I see, everything works as expected on my end. The only thing I don’t like here is that the Explore Elements link immediately realizes the lazy seq without prompting, but not a big deal.

not-realized cannot be expanded at all without changing the default viewer via RMB → View as.
realized can be fully expanded and all the items are there, same for as-vector.

(Don’t pay any attention to that :gap - it’s a common issue when debugging Clojure where a breakpoint ends up being triggered earlier than where it was put, for some reason.)