<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged dats</title>
<link>https://ask.clojure.org/index.php/tag/dats</link>
<description></description>
<item>
<title>Clojurescript core.async go block incorrectly handles records returned from tagged literals</title>
<link>https://ask.clojure.org/index.php/10987/clojurescript-incorrectly-handles-records-returned-literals</link>
<description>&lt;p&gt;In clojurescript, I have a data reader that returns a record from a tagged literal:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns x.x)

(defrecord X [y])

(defn make-x [y] (-&amp;gt;X y))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;data_readers.cljc:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{x x.x/make-x}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This doesn't work correctly inside of go blocks:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(println &quot;outside of go:&quot; #x&quot;a&quot;)
(go
  (println &quot;inside of go:&quot; (&amp;lt;! (go #x&quot;b&quot;))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Results in:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;outside of go: #x.x.X{:y a}
inside of go: {:y b}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;@hiredman on the clojurians slack pointed out the issue:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;what is happening is here&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/impl/ioc_macros.clj#L403&quot;&gt;https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/impl/ioc_macros.clj#L403&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;map? is returning true so it is compiling your record as a map&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10987/clojurescript-incorrectly-handles-records-returned-literals</guid>
<pubDate>Fri, 27 Aug 2021 18:53:31 +0000</pubDate>
</item>
</channel>
</rss>