Skip to content

Conversation

@E-A-Griffin
Copy link
Collaborator

@E-A-Griffin E-A-Griffin commented Oct 15, 2025

Addresses comments in #762 (comment) for @gavlooth 's work; fixes/closes #354 (comment)

@E-A-Griffin
Copy link
Collaborator Author

@jeaye on the local cljs repls I have I get an error for (mapcat identity (range 2)) any idea why the CI suite gets a different result?

@jeaye
Copy link
Member

jeaye commented Oct 15, 2025

(mapcat identity (range 2))

Could be node vs browser JS? What if you run the CLJS tests locally?

@jeaye
Copy link
Member

jeaye commented Oct 15, 2025

I get the same in a CLJS browser REPL.
image

@E-A-Griffin
Copy link
Collaborator Author

Same thing locally, I wonder if it has something to do with the transpilation

@E-A-Griffin
Copy link
Collaborator Author

clojure.core-test.mapcat> (emma-test)

FAIL in (emma-test) (:1:37)
x
expected: (thrown? :default (mapcat identity (range 2)))
  actual: nil

Okay reproduced it with cider, I'll look into this tonight

@E-A-Griffin
Copy link
Collaborator Author

(deftest emma-test2 (testing "y" (is (nil? (mapcat identity (range 2))))))
;; => #'clojure.core-test.mapcat/emma-test2
cljs.user> (in-ns 'clojure.core-test.mapcat)
;; => nil
clojure.core-test.mapcat> (emma-test2)

FAIL in (emma-test2) (:1:38)
y
expected: (nil? (mapcat identity (range 2)))

ERROR in (emma-test2) (:1:38)
y
expected: (nil? (mapcat identity (range 2)))
  actual: #object[Error Error: 0 is not ISeqable]
;; => nil

So it looks like there's a certain class of error that isn't being caught for some reason?

@E-A-Griffin
Copy link
Collaborator Author

@jeaye it's a quirk with cljs's laziness, since the lazy-seq isn't realized yet, nothing is thrown, easy fix for this issue but something to keep in mind for sure

:url "https://www.mozilla.org/en-US/MPL/2.0/"}
:dependencies [[org.clojure/clojure "1.12.0"]]
:dependencies [[org.clojure/clojure "1.12.0"]
[org.clojure/clojurescript "1.12.42"]]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cider doesn't work on this project without this, @jeaye if you want me to do this in a separate PR that's fine but I think we should have it

@E-A-Griffin E-A-Griffin requested a review from jeaye October 17, 2025 15:30
@jeaye jeaye merged commit 05fb93a into jank-lang:main Oct 17, 2025
2 checks passed
@jeaye
Copy link
Member

jeaye commented Oct 17, 2025

Nice work, Emma and Christos!

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

Successfully merging this pull request may close these issues.

clojure.core/mapcat

3 participants