Fork me on GitHub
#cljs-dev
<
2019-11-19
>
dnolen00:11:41

was a bit busy today - just updated changes and cutting a release now - but let's do the post tomorrow

Alex Miller (Clojure team)00:11:34

fyi, now that gh is past the beta period, we are still working out getting the cognitect accts set up billing wise so I'm building sites manually again, so you'll need to ping me to publish

eltonlaw05:11:33

Hi, I'm encountering some weird behaviour and was wondering if this was a bug, for this code

(defmacro foo [x & args]
  (println "&form:" &form)
  (println "&env:" &env)
  (println "args:" args))

(foo 1 2 3 4 5 6)
in clojure:
$ java -jar clojure.jar
Clojure 1.11.0-master-SNAPSHOT
...
user=> user=> (foo 1 2 3 4 5 6)
&form: (foo 1 2 3 4 5 6)
&env: nil
args: (2 3 4 5 6)
nil
which makes sense, but in clojurescript looks like this:
$ ./script/repljs
ClojureScript 1.10.598
...
cljs.user=> cljs.user=> (foo 1 2 3 4 5 6)
&form: 1
&env: 2
args: (4 5 6)
nil

thheller10:11:26

@eltonlaw296 macros for CLJS are defined in CLJ. did you just use defmacro in the REPL? if so it'll be called as a regular function which will "eat" the first two args as &form and &env ending up with your result

eltonlaw11:11:31

ah yea, I was using defmacro in the repl, I see I understand now thanks for clearing that up!

borkdude12:11:57

I ran into an issue with the analysis order in CLJS once: https://clojure.atlassian.net/browse/CLJS-2949 Funny enough to mention that I made the same "mistake" in a Clojure interpreter: https://github.com/borkdude/sci/issues/164

borkdude12:11:09

what's up with this though?

$ clj -e '(def x 1) (declare y) (try (assert (pos? x)) (def y (+ 1 2 x)) y (finally (assert (pos? y))))'
#'user/x
#'user/y
4
$ plk -e '(def x 1) (declare y) (try (assert (pos? x)) (def y (+ 1 2 x)) y (finally (assert (pos? y))))'
Execution error (Error) at (<cljs repl>:1).
Var is not a function (near '...$test:null)])));})()...')

mfikes13:11:24

(It doesn’t happen with the Node or browser REPLs.)

borkdude13:11:50

Ah right, it doesn't happen in a plk REPL, only with -e

borkdude13:11:48

$ clojure -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.520"}}}' -m cljs.main -re node -e '(def x 1) (declare y) (try (assert (pos? x)) (def y (+ 1 2 x)) y (finally (assert (pos? y))))'
#'cljs.user/x
#'cljs.user/y
4

borkdude13:11:14

I notice that Herald is only a single first name (or last name). Is it incomplete?

mfikes13:11:05

I did my best to find the name of that contributor. That’s how his/her name is listed on GitHub

dnolen13:11:51

@mfikes looks good, feel free to merge

dnolen13:11:27

@alexmiller please push the publish button whenever you get a chance 🙂

borkdude14:11:38

maybe an announcement on https://twitter.com/cognitect? 🙂

Alex Miller (Clojure team)15:11:08

is everything official now?