Fork me on GitHub
#clojure-dev
<
2018-05-08
>
danielcompton01:05:46

I've never come across something like that

seancorfield01:05:44

We have a small library that is a bit like that. We're in the unusual situation of having to bridge between Clojure and a language that has hash maps with case-insensitive keys(!), so we created a library that converts native Clojure data structures and native structures from the other language into a common set of data structures that satisfy both languages. Sets become hash maps with true values for all keys. Any sort of map (from either side) becomes a map that accepts lookup via strings or keywords and is not case sensitive (behind the scenes it uses uppercase strings, to support an edge case in the non-Clojure language).

seancorfield01:05:24

I wouldn't think this is a very common need tho', since Clojure can generally interop pretty well with other JVM languages' data structures?

cfleming01:05:58

I’m not aware of anything like this either, but I’m probably going to need something similar to convert from the Java EDN lib to actual EDN.

andy.fingerhut19:05:00

@alexmiller I've taken your edits to the equality article you made and incorporated them, plus made many more changes to my equality article, in my Github repo here: https://github.com/jafingerhut/thalia/blob/master/doc/other-topics/equality.md I can convert it to .adoc format and create a PR for the clojure-site repository if you are interested.

andy.fingerhut20:05:21

done. I have removed most or all mentions of Clojure 1.5.1 -- I believe that was the current Clojure release when I wrote it, but is mostly of historical interest now. I do mention Clojure 1.6.0 once, but only in a historical note explaining a bit of history on why non-Clojure collections are hash-inconsistent with Clojure collections.

andy.fingerhut20:05:03

The early summary part tries to emphasize the similarity with egal (without mentioning egal): Clojure is 'equal values' for values, 'identical objects' for mutable objects, and as a convenience, also returns true between Clojure and non-Clojure collections, but with caveats.

Alex Miller (Clojure team)20:05:25

thx, I may have time to look at it on Friday