Welcome! Please see the About page for a little more info on how this works.
According to the docstring for doseq, the following should return nil.
nil
user> (doseq [] "not nil") "not nil"
Comment made by: admay
I think this fixes this issue.
Theres a (do ...) that runs if (seq exprs) is nil but the return of that do isn't necessarily nil if your body is something that doesn't return nil.
(do ...)
(seq exprs)
do
Comment made by: mfikes
It is odd that {{doseq}} even has code for this case given that the docstring indicates the bindings and filterings are as provided by "for." Since {{for}} requires one or more binding forms, it raises the question of whether {{(doseq [] "not nil")}} is a valid program.
Comment made by: alexmiller
Test?
Here's a bit of tests! I think these are suitable for the use case of doseq. I just went with similar tests to dotimes since they're so similar.
doseq
dotimes
I removed the println from the original tests in favor of identity. It seemed more appropriate so you don't have a random 'foo' in the test print-out.
println
identity