Skip to content

Commit

Permalink
Fix all calls to (Object) to produce unique (distinct) values
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrand committed Jan 31, 2023
1 parent adbe8bc commit 161e2e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions clj/src/cljd/core.cljd
Expand Up @@ -12,7 +12,7 @@
["dart:io" :as dart-io]
["dart:async" :as dart-async]))

(def ^:private sentinel (Object.))
(def ^:private sentinel ^:unique (Object.))

(def ^:macro-support argument-error
(fn [msg]
Expand Down Expand Up @@ -1647,7 +1647,7 @@
(when (and (map? y) (not (record? y)))
; assume all maps are counted
(when (== (count x) (count y))
(let [never-equiv (Object.)]
(let [never-equiv ^:unique (Object.)]
(if (satisfies? IKVReduce x)
(reduce-kv
(fn [_ k v]
Expand Down Expand Up @@ -3583,7 +3583,7 @@
(-nth coll k not-found))
IEditableCollection
(-as-transient [coll]
(TransientVector. cnt shift (Object.) root (aresize tail (.-length tail) 32 nil)))
(TransientVector. cnt shift ^:unique (Object.) root (aresize tail (.-length tail) 32 nil)))

#_#_IReversible
(-rseq [coll]
Expand Down
3 changes: 2 additions & 1 deletion clj/src/cljd/flutter/alpha2.cljd
Expand Up @@ -638,6 +638,7 @@
(-unsubscribe s (.remove subs s)))
(when-not (= v v')
(set! v v')
(dart:core/print (str (dart:core/identityHashCode self) " distributing to " (count subscribers) " subscribers"))
(doseq [f! (.-values subscribers)]
(f! v'))))))
(update [self s x]
Expand All @@ -653,7 +654,7 @@
(dart:core/print (str "sub cell " (dart:core/identityHashCode self)))
(when (zero? (.-length subscribers))
(.refresh self))
(let [sub (Object)]
(let [sub ^:unique (Object)]
(. subscribers "[]=" sub f!)
(f! v)
sub))
Expand Down

0 comments on commit 161e2e9

Please sign in to comment.