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

cljs built in types #781

Closed
lilactown opened this issue Jul 25, 2022 · 0 comments · Fixed by #784
Closed

cljs built in types #781

lilactown opened this issue Jul 25, 2022 · 0 comments · Fixed by #784

Comments

@lilactown
Copy link
Contributor

lilactown commented Jul 25, 2022

version

0.3.32 and master

platform

macOS / Nodejs v18.3.0

problem

babashka/nbb#242 details some of the behavior when trying to use SCI to load some CLJS code that extends JS default types. I'm creating an issue here to track it and relate to a fix I have in the works in sci.impl.protocols.

repro

(defprotocol IFoo (foo [_]))

(extend-protocol IFoo
  object (foo [_] :object)
  string (foo [_] :string)
  number (foo [_] :number)
  array (foo [_] :array)
  function (foo [_] :function)
  boolean (foo [_] :boolean))

(map #(vector (satisfies? IFoo %) (foo %)) [#js {} "" 1 #js [] inc true])

expected result

([true :object] [true :string] [true :number] [true :array] [true :function] [true :boolean])

actual result

It attempts to resolve the type symbols (and throws an error for most of them).

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