Fork me on GitHub
#clojure-dev
<
2018-09-24
>
andy.fingerhut19:09:23

Wow, I haven't looked at Clojure build matrix results on http://build.clojure.org in a long time. So many JDKs.

alexmiller19:09:19

within the last 6 months I’ve almost completely swapped out the old set (with Oracle 8 maybe the only common one between old and new)

andy.fingerhut19:09:06

I do not miss IBM JDK 1.6

alexmiller19:09:27

heh, me neither. but in the brave new open jdk world we might have a whole bloom of variants

alexmiller19:09:39

not looking forward to that much

mfikes20:09:41

There are also the new Graal VMs that are similar but different

mfikes20:09:22

Community and enterprise variants to boot

slipset20:09:22

In which @mfikes writes “while also dealing with the trick that vec and set employ when using with-meta to force a new object to be created”

slipset20:09:37

This brings up two questions wrt Clojure

slipset20:09:49

1) The doc-string for set does not specify that a new set is created, although https://dev.clojure.org/jira/browse/CLJ-1618 seems to indicate that a new set should be created.

slipset20:09:56

2) With https://dev.clojure.org/jira/browse/CLJ-2362, calling set on a set does no longer create a new set, since the (with-meta coll nil) trickery doesn’t return a new set, unless the original set has meta-data

slipset20:09:40

3) which also breaks the doc string for vec, which clearly states that it returns a new vector:

slipset20:09:51

Clojure 1.10.0-alpha8
user=> (let [v [1 2]] (identical? (vec v) v))
true

alexmiller20:09:41

1) the “new set” there is specifically about the case where there is meta returning a set with no meta. it doesn’t say that a set with no meta needs to return a new instance

alexmiller20:09:21

stepping back, what is the interesting case where behavior has changed?

alexmiller20:09:59

with persistent colls, there are great advantages to reusing identical instances when possible

alexmiller20:09:59

one of the few cases where set/vec return an observably different instance is in the case of meta, and while I think that use case was more accidental than intentional, it’s been preserved

slipset20:09:40

I guess this started as a question of “why is the doc-string for set and vec different wrt returning a new object?”

slipset20:09:16

which all ended up in 3) where the docstring for vec is no longer correct.

alexmiller20:09:18

my guess would be that they were not intended to be meaningfully different

alexmiller20:09:44

and unless there is some really good reason, I’d be more inclined to adjust the doc string to clarify than the code

slipset20:09:21

I’d be happy with the latter as that would make the patch for CLJS-2794 smaller.

mfikes20:09:13

I like thinking of set and vec as coercion fns; it would be nice if they act as the identity function when they can

alexmiller21:09:48

just fyi, I am soon slipping over the Strange Loop event horizon and will re-emerge in some future dimension (aka next week)

mfikes21:09:04

See you on the flip side. 🙂

slipset21:09:42

Have great conf, Alex!

andy.fingerhut21:09:51

... Alex returns to find several of us have reported him missing ...