Fork me on GitHub
#cljs-dev
<
2022-02-14
>
borkdude09:02:32

Is this expected? Probably an implementation detail of vararg functions?

cljs.user=> (defn foo [_ & args] (js-arguments))
#'cljs.user/foo
cljs.user=> (foo 1 2 3)
#js {"0" 1, "1" (2 3)}

1
😍 1
favila13:02:00

Expected, not sure what other way it could be?

favila13:02:19

We’re you expecting a js array for the second arg?

borkdude14:02:17

I guess I was expecting an array for the whole thing

borkdude14:02:21

not an object with string keys

borkdude14:02:10

but I guess this is JS behavior

favila14:02:09

Ah I see. yeah, js-arguments is an arguments object, which is magic in JS

favila14:02:40

I’d internalized it so hard I didn’t even see “gosh its odd it printed as a map”

borkdude10:02:14

A different issue btw, when I use 1.11.4, and try to load a namespace in the Node REPL, I get:

$ clj -Sdeps '{:paths ["."] :deps {org.clojure/clojurescript {:mvn/version "RELEASE"}}}'  -M -m cljs.main -re node
ClojureScript 1.11.4
cljs.user=> (require '[sci.impl.fns] :reload)
Unexpected error (ExceptionInfo) compiling at (<cljs repl>:1:1).
No such namespace: sci.impl.fns, could not locate sci/impl/fns.cljs, sci/impl/fns.cljc, or JavaScript source providing "sci.impl.fns" at line 1 <cljs repl>
It works with SHA f3e0bb503333bb53c4312d4bc19aa24505185667 (latest on master currently). Maybe 1.11.4 is an accidentally released thing?

Alex Miller (Clojure team)14:02:41

let me know if you want me to make a jira out of that

lread19:02:27

@borkdude I originally assumed cljs v1.11.4 was a beta/early release, just because of the 11. But I see it referenced in the description of #clojurescript and also the change logs. That said, https://clojurescript.org/. So still a bit not sure.

thheller19:02:10

@borkdude given the :paths ["."] I assume you run this in the sci repo? are you sure you are in the correct directory? missing some context there

borkdude19:02:51

@thheller Oh crap, you're right. That :paths was from a previous experiment in which I wanted to load a script in the current directory. Deleting that fixed it. Major facepalm.

picard-facepalm 2
👍 1
lread19:02:10

@borkdude maybe a facepalm, but you still raised an interesting question regarding current official release. I think the 11 might make folks wonder a bit. (It did me).

☝️ 1
dnolen21:02:45

I think website just needs a rebuild? \cc @alexmiller

👀 1
dnolen21:02:49

1.11.4 is a thing

👍 3
borkdude22:02:40

@alexmiller The CLJS site links to Cognitect 24x7 support for ClojureScript, but the link is dead.