Skip to content

Commit dd58903

Browse files
cvermiliondnolen
authored andcommitted
CLJS-1635: Var type implements IEquiv but not IHash
Extends the Var deftype to implement the IHash protocol, with similar semantics to its IEquiv implementation: two var's should compare and hash equal iff their symbol is the same.
1 parent 7a29362 commit dd58903

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,9 @@
10121012
(if (instance? Var other)
10131013
(= (.-sym this) (.-sym other))
10141014
false))
1015+
IHash
1016+
(-hash [_]
1017+
(hash-symbol sym))
10151018
Fn
10161019
IFn
10171020
(-invoke [_]

0 commit comments

Comments
 (0)