Clojurians
#cljs-dev
<
2016-04-26
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

r0man19:04:57

@mfikes: Hey Mike, just saw your comment on the pr-str ticket and looking into this. Do you know why the maps are out of order?

mfikes19:04:10

@r0man: I suspect, for small maps, the difference is due to the use of different readers.

r0man19:04:50

ok,thanks. since there are only 2 different combinations how they could be printed I'll do the same as you did and use a set

r0man20:04:33

@mfikes: The tests are running now also in bootstrap and I updated the patch.

cvermilion20:04:26

possible bug: cljs.core/Var implements IEquiv but not IHash, so that equivalent vars compare equal but have different hashes — (= #’foo #’foo) but (not= (hash #’foo) (hash #’foo))

cvermilion20:04:02

but maybe I’m missing a subtle reason two vars with the same symbol shouldn’t hash equal

dnolen20:04:53

@cvermilion: there’s no way to really guarantee that Vars will be the same thing

dnolen20:04:08

so IEqiuv and IHash aren’t really useful or meaningful for vars in ClojureScript

cvermilion20:04:29

hmm, interesting

dnolen20:04:39

the only reason vars exist in ClojureScript is for cljs.test

dnolen20:04:05

(and bootstrap implementation details) otherwise you shouldn’t be using them

cvermilion20:04:31

I ran into this debugging recursive schemas in schema.core

cvermilion20:04:25

and this issue means that you get funny results if you define (s/recursive #’SomeSchema) twice

dnolen20:04:45

I don’t know anything about Schema sorry

cvermilion20:04:57

since the resulting schemas compare but don’t hash equal, and schema does some caching where it uses the schemas as keys

dnolen20:04:03

in anycase vars in ClojureScript matching Clojure is a total non-goal

cvermilion20:04:06

no worries, just wanted to let you know where it came up

dnolen20:04:06

it’s that simple

cvermilion20:04:44

ok, cool, I wanted to check that before filing a report; feels like the solution is finding a better way to do recursive schemas in Schema

dnolen20:04:07

now that I think about it I may have fixed the vars pointing at the right thing

dnolen20:04:15

out of necessity

dnolen20:04:46

so IHash is probably just a minor enhancement - would take ticket (minor) + patch

cvermilion20:04:21

ok, I can write that up if you think it would make sense

dnolen20:04:25

since vars are mapped to symbols and are compile time only hashing the symbol is probably good enough

cvermilion20:04:43

right, that would match how IEquiv works

cvermilion20:04:54

two vars compare equal if the symbols are the same

dnolen20:04:35

ok, patch welcome. @cvermilion did you submit your CA?

cvermilion20:04:45

I don’t think so, I’ll make sure I do first