<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent activity in data.int-map</title>
<link>https://ask.clojure.org/index.php/activity/contrib-libs/data-int-map</link>
<description></description>
<item>
<title>int-map: difference ignores its second argument when the first is itself a difference result</title>
<link>https://ask.clojure.org/index.php/15241/difference-ignores-second-argument-itself-difference-result</link>
<description>&lt;pre&gt;&lt;code&gt;(require '[clojure.data.int-map :as i])

(-&amp;gt; (i/int-set [10 1000297])
      (i/difference (i/int-set [10]))        ;=&amp;gt; #{1000297}
      (i/difference (i/int-set [1000297])))  ;=&amp;gt; #{1000297}, expected #{}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When SingleContainer/difference removes its only element, it returns null.  IntSet/difference puts that null into the tree instead of dropping the key. In the next difference, the entry with the null value goes to the else branch, which is meant for k1 &amp;gt; k2. That branch moves i2 forward without comparing anything, so the rest of the first set gets copied as is.&lt;/p&gt;
&lt;p&gt;Skipping null values from the first set in that loop should fix it. So should not storing empty results in the first place. :)&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15241/difference-ignores-second-argument-itself-difference-result</guid>
<pubDate>Fri, 02 Oct 2026 11:28:00 +0000</pubDate>
</item>
<item>
<title>Retagged: Document that clojure.data.int-map is sorted</title>
<link>https://ask.clojure.org/index.php/12778/document-that-clojure-data-int-map-is-sorted?show=12778#q12778</link>
<description>&lt;p&gt;Recently a question about it &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1679007293266749&quot;&gt;was asked on Slack&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DIMAP-4&quot;&gt;DIMAP-4 Jira ticket&lt;/a&gt; has made the map and the set deliberately sorted, but it was never mentioned in the docs.&lt;br&gt;
Seems like it could be explicitly mentioned in the docstrings?&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12778/document-that-clojure-data-int-map-is-sorted?show=12778#q12778</guid>
<pubDate>Thu, 23 Mar 2023 15:21:41 +0000</pubDate>
</item>
<item>
<title>Answer selected: Should data.int-map's allow assoc'ing non-integer keys?</title>
<link>https://ask.clojure.org/index.php/12588/should-data-int-maps-allow-associng-non-integer-keys?show=12593#a12593</link>
<description>&lt;p&gt;The stated constraint of int-map/set is that they have integer keys, and can gain performance advantages for this use case. If you want that, you should use int-map. If you don't, you should use a standard map.&lt;/p&gt;
&lt;p&gt;So, I think it's beneficial that adding a non-int key to an int-map throws, and this should not change.&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12588/should-data-int-maps-allow-associng-non-integer-keys?show=12593#a12593</guid>
<pubDate>Fri, 27 Jan 2023 19:26:34 +0000</pubDate>
</item>
<item>
<title>Answer selected: clojure.data.int-map could use shared empty singleton instances</title>
<link>https://ask.clojure.org/index.php/12553/clojure-data-int-map-could-shared-empty-singleton-instances?show=12560#a12560</link>
<description>&lt;p&gt;Logged these as:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DIMAP-17&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-17&lt;/a&gt;&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DIMAP-18&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-18&lt;/a&gt;&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12553/clojure-data-int-map-could-shared-empty-singleton-instances?show=12560#a12560</guid>
<pubDate>Tue, 17 Jan 2023 19:26:47 +0000</pubDate>
</item>
<item>
<title>Answer selected: clojure.data.int-map Branch nodes allocate unused ArrayLists</title>
<link>https://ask.clojure.org/index.php/12555/clojure-data-int-map-branch-nodes-allocate-unused-arraylists?show=12561#a12561</link>
<description>&lt;p&gt;Fixed for next release, thanks&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12555/clojure-data-int-map-branch-nodes-allocate-unused-arraylists?show=12561#a12561</guid>
<pubDate>Tue, 17 Jan 2023 19:26:15 +0000</pubDate>
</item>
<item>
<title>Answer selected: clojure.data.int-map Branch nodes could use bitmaps to save space</title>
<link>https://ask.clojure.org/index.php/12554/clojure-data-int-map-branch-nodes-could-use-bitmaps-save-space?show=12562#a12562</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DIMAP-19&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-19&lt;/a&gt;&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12554/clojure-data-int-map-branch-nodes-could-use-bitmaps-save-space?show=12562#a12562</guid>
<pubDate>Tue, 17 Jan 2023 19:25:57 +0000</pubDate>
</item>
<item>
<title>`intersection` and `union` do not support `nil` punning</title>
<link>https://ask.clojure.org/index.php/10996/intersection-and-union-do-not-support-nil-punning</link>
<description>&lt;p&gt;This is for org.clojure/data.int-map  v 1.0.0.&lt;br&gt;
At the same time &lt;code&gt;clojure.set/intersection&lt;/code&gt; and &lt;code&gt;clojure.set/union&lt;/code&gt; handle the case well.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns sandbox
  (:require
   [clojure.data.int-map :as int-map]
   [clojure.set]))

(clojure.set/intersection #{1 3} #{1 2 3}) ; =&amp;gt; #{1 3}
(clojure.set/intersection #{1 3} nil) ; =&amp;gt; nil
(clojure.set/intersection nil #{1 2 3}) ; =&amp;gt; nil

(int-map/intersection (int-map/int-set #{1 3}) (int-map/int-set #{1 2 3})) ; =&amp;gt; #{1 3}
(int-map/intersection (int-map/int-set #{1 3}) nil) ; =&amp;gt; NullPointerException
(int-map/intersection nil (int-map/int-set #{1 2 3})) ; =&amp;gt; NullPointerException

(clojure.set/union #{1 3} #{2}) ; =&amp;gt; #{1 3 2}
(clojure.set/union #{1 3} nil) ; =&amp;gt; #{1 3}
(clojure.set/union nil #{2}) ; =&amp;gt; #{2}

(int-map/union (int-map/int-set #{1 3}) (int-map/int-set #{2})) ; =&amp;gt; #{1 2 3}
(int-map/union (int-map/int-set #{1 3}) nil) ; =&amp;gt; NullPointerException
(int-map/union nil (int-map/int-set #{2})) ; =&amp;gt; NullPointerException
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10996/intersection-and-union-do-not-support-nil-punning</guid>
<pubDate>Tue, 31 Aug 2021 16:51:39 +0000</pubDate>
</item>
<item>
<title>Answered: Why does PersistentPriorityMap kv-reduce call the reducing function with item and priority?</title>
<link>https://ask.clojure.org/index.php/10136/persistentprioritymap-reduce-reducing-function-priority?show=10143#a10143</link>
<description>&lt;p&gt;It should be a bug in there&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/data.priority-map/blob/master/src/main/clojure/clojure/data/priority_map.clj#L396&quot;&gt;https://github.com/clojure/data.priority-map/blob/master/src/main/clojure/clojure/data/priority_map.clj#L396&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Maybe &lt;code&gt;(reduce (fn [a v] (f a v k)) a [k v])&lt;/code&gt; will be the right solution. Not shure&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10136/persistentprioritymap-reduce-reducing-function-priority?show=10143#a10143</guid>
<pubDate>Wed, 03 Feb 2021 13:45:27 +0000</pubDate>
</item>
<item>
<title>Answered: support element lookup on transient sets</title>
<link>https://ask.clojure.org/index.php/8151/support-element-lookup-on-transient-sets?show=8169#a8169</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-14&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-14&lt;/a&gt; (reported by alex+import)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8151/support-element-lookup-on-transient-sets?show=8169#a8169</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: int sets return false for .equals and = when comparing against java.util.Set, and similarly for int maps against java.ut</title>
<link>https://ask.clojure.org/index.php/8150/return-false-equals-comparing-against-java-similarly-against?show=8167#a8167</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-16&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-16&lt;/a&gt; (reported by jafingerhut)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8150/return-false-equals-comparing-against-java-similarly-against?show=8167#a8167</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Proper seq on int-sets</title>
<link>https://ask.clojure.org/index.php/8149/proper-seq-on-int-sets?show=8165#a8165</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-2&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-2&lt;/a&gt; (reported by alex+import)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8149/proper-seq-on-int-sets?show=8165#a8165</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Support efficient rseq on int maps</title>
<link>https://ask.clojure.org/index.php/8148/support-efficient-rseq-on-int-maps?show=8164#a8164</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-1&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-1&lt;/a&gt; (reported by alex+import)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8148/support-efficient-rseq-on-int-maps?show=8164#a8164</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Union, intersection and difference have only 2 arguments versions</title>
<link>https://ask.clojure.org/index.php/8147/union-intersection-difference-have-only-arguments-versions?show=8163#a8163</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-8&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-8&lt;/a&gt; (reported by jbiserkov)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8147/union-intersection-difference-have-only-arguments-versions?show=8163#a8163</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Unlike regular transient sets, data.int-map transient sets do not support the IFn interface</title>
<link>https://ask.clojure.org/index.php/8146/unlike-regular-transient-sets-transient-support-interface?show=8159#a8159</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-9&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-9&lt;/a&gt; (reported by markengelberg)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8146/unlike-regular-transient-sets-transient-support-interface?show=8159#a8159</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Minor typos in README and docstring</title>
<link>https://ask.clojure.org/index.php/8145/minor-typos-in-readme-and-docstring?show=8158#a8158</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-7&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-7&lt;/a&gt; (reported by blx)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8145/minor-typos-in-readme-and-docstring?show=8158#a8158</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Cannot merge int-sets of different density.</title>
<link>https://ask.clojure.org/index.php/8144/cannot-merge-int-sets-of-different-density?show=8155#a8155</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-13&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-13&lt;/a&gt; (reported by jbiserkov)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8144/cannot-merge-int-sets-of-different-density?show=8155#a8155</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: int-map doc string is overly restrictive?</title>
<link>https://ask.clojure.org/index.php/8143/int-map-doc-string-is-overly-restrictive?show=8154#a8154</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-6&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-6&lt;/a&gt; (reported by jafingerhut)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8143/int-map-doc-string-is-overly-restrictive?show=8154#a8154</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: PersistentIntMap equals/equiv gives wrong result</title>
<link>https://ask.clojure.org/index.php/8142/persistentintmap-equals-equiv-gives-wrong-result?show=8152#a8152</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DIMAP-15&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DIMAP-15&lt;/a&gt; (reported by ragge)</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8142/persistentintmap-equals-equiv-gives-wrong-result?show=8152#a8152</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
</channel>
</rss>