Fork me on GitHub
#clojurescript
<
2021-10-10
>
Adam Helins12:10:00

Am I missing something?! Whatever I try, .push on JS arr seems to be ignored in a goroutine when the array is created in that goroutine. E.g. following prints only #js [1]

(async/go
  (let [arr #js [1]]
    (.push arr 2)
    (println arr)))

p-himik12:10:57

CLJS's core.async is very funky when it comes to metadata and reader tags.

p-himik12:10:10

Try replacing #js [1] with (array 1).

Adam Helins12:10:35

I suspects it is indeed about the tag but yet I can't understand what's going on because arr is indeed a JS array.

Adam Helins12:10:58

When I print the type and all, I mean. It's not like tag is ignored for instance.

p-himik12:10:30

Trying to understand it would require going through the broken code of core.async. No reason to do that when you know how to not trigger its bad behavior, and IIRC David either plans to work or is already working on it.

Adam Helins12:10:59

Yep. For context, I get that kind of problems with arrays but not objects.

Adam Helins12:10:54

So anyways, this is known? I shouldn't report it anywhere?

p-himik12:10:14

As I said - @U050B88UR knows about it and either is working or plans to work on it, as he himself mentioned not so long ago.

👍 1
dnolen13:10:44

It’s an old bug and it’s been tracked in JIRA

dnolen13:10:58

It is a priority for sure

🙏 2