workspace
stringclasses 4
values | channel
stringclasses 4
values | text
stringlengths 1
3.93k
| ts
stringlengths 26
26
| user
stringlengths 2
11
|
---|---|---|---|---|
clojurians | clojure | Where? | 2017-12-08T09:32:17.000022 | Marx |
clojurians | clojure | <https://github.com/clojure/clojure/releases/tag/clojure-1.9.0> | 2017-12-08T09:36:39.000276 | Kareen |
clojurians | clojure | doesn't seem like it's in maven central yet, but it should be soon | 2017-12-08T09:36:50.000384 | Kareen |
clojurians | clojure | ` while [[ "$(curl -s -o/dev/null '<https://mvnrepository.com/artifact/org.clojure/clojure/1.9.0>' -D - | awk '/^HTTP/{ print $2 }')" -ne "200" ]]; do sleep 2; done; echo 🎉;` | 2017-12-08T09:42:30.000298 | Jutta |
clojurians | clojure | Congrats to the core team -- nice work, y'all :clap: | 2017-12-08T10:00:53.000320 | Lavenia |
clojurians | clojure | For any that are interested I put a bit more in the readme to attempt to explain things a bit better | 2017-12-08T10:07:38.000541 | Elmira |
clojurians | clojure | :champagne: | 2017-12-08T10:10:43.000617 | Jami |
clojurians | clojure | Cool, also just noticed this: <https://github.com/Homebrew/homebrew-core/pull/21470/files> | 2017-12-08T10:20:46.000637 | Dirk |
clojurians | clojure | But <http://clojure.org|clojure.org> still has nothing about release | 2017-12-08T10:22:22.000453 | Heriberto |
clojurians | clojure | ```
$> lein test
Retrieving org/clojure/clojure/1.9.0/clojure-1.9.0.pom from central
Retrieving org/clojure/clojure/1.9.0/clojure-1.9.0.jar from central
```
: ) | 2017-12-08T10:25:38.000265 | Joette |
clojurians | clojure | give the core team some time :) | 2017-12-08T10:27:47.000430 | Kareen |
clojurians | clojure | <@Elmira> (pinging him here to add him to this thread) | 2017-12-08T13:10:42.000314 | Sandy |
clojurians | clojure | The big difference vs mount is that this doesn't use global singletons, which is what I absolutely can't stand about mount. | 2017-12-08T13:11:12.000244 | Sandy |
clojurians | clojure | It looks like objection is a global (singleton) registry of any number of components. | 2017-12-08T13:11:51.000051 | Sandy |
clojurians | clojure | So if you need more than one DB connection you can simply start up and register multiple connections. All components seem to have their own UUIDs keeps components from getting lost, as well as allows for multiple instances of the same component. | 2017-12-08T13:12:56.000553 | Sandy |
clojurians | clojure | <@Elmira> I don't *not* like it, and the more I think about it the more I like it. :slightly_smiling_face: | 2017-12-08T13:13:22.000219 | Sandy |
clojurians | clojure | for recursively looking at the fs, check out `file-seq` - it returns a lazy seq of files | 2017-12-08T13:14:22.000468 | Margaret |
clojurians | clojure | also I would assume DaisyDisk is exploiting your mac’s spotlight cache, or you have a very small file system and the clojure approach was extremely inefficient | 2017-12-08T13:15:14.000018 | Margaret |
clojurians | clojure | Thanks <@Sandy> | 2017-12-08T13:44:47.000277 | Elmira |
clojurians | clojure | Singletons aren't always bad (e.g queue and threadpool used as some internal optimization, no effect on api, want flexibility to change locally) - so I do support them. | 2017-12-08T13:46:39.000363 | Elmira |
clojurians | clojure | Not sure about using them for all state though, so I wanted to make the dynamic/open case the primary one. | 2017-12-08T13:47:11.000225 | Elmira |
clojurians | clojure | I've always been a component/integrant user too, not really used mount - though I tried it a couple of times | 2017-12-08T13:47:36.000587 | Elmira |
clojurians | clojure | I have been doing some brain storming on how to make more understandable software. I’m trying to turn those ideas into something actionable, maybe a clojure library. The current idea is to give projects more of a narrative. I wrote up a quick proposal of what this might look like here: <https://github.com/drewverlee/narrative/blob/master/ideas.md>
I welcome any feedback. Thanks | 2017-12-08T13:57:48.000198 | Glory |
clojurians | clojure | I think good tests read like a commentary track dvd extra for the code - so it should have at least that level of narrative | 2017-12-08T14:10:39.000663 | Margaret |
clojurians | clojure | there’s some interesting ideas here, thanks | 2017-12-08T14:10:56.000367 | Margaret |
clojurians | clojure | ```
(merge nil {:a 2})
(comment
{:a 2})
(merge (persistent! (transient nil)) {:a 2})
;; ==> exception
```
is this because transient can't figure out if nil should become {} () [] or #{} ? | 2017-12-08T14:26:38.000699 | Berry |
clojurians | clojure | you can't make a transient out of nil | 2017-12-08T14:27:40.000473 | Kareen |
clojurians | clojure | so yes | 2017-12-08T14:27:48.000562 | Sandy |
clojurians | clojure | What you want is (transient (empty {:a 2})) or something like that | 2017-12-08T14:28:10.000635 | Sandy |
clojurians | clojure | well, thinking that it's because "transient can't figure out if nil should become [] () [] or #{}" is a bit of a mis-statement | 2017-12-08T14:28:25.000065 | Kareen |
clojurians | clojure | Right, "can't create transient from null" is the technical reason. "can't figure out if..." is the reason that it's not fixed | 2017-12-08T14:29:21.000124 | Sandy |
clojurians | clojure | the context is that I wrote this function:
```
(defn merge-drop-vEmpty [a b]
(persistent!
(reduce (fn [old [k v]]
(if (or (= v nil) (= v {}))
(dissoc! old k)
(assoc! old k v)))
(transient a) b)))
``` | 2017-12-08T14:29:28.000640 | Berry |
clojurians | clojure | and it's a bit weird, since `(merge nil {...})` is fine but `(merge-drop-vEmpty nil {...})` is bad | 2017-12-08T14:29:56.000444 | Berry |
clojurians | clojure | Well you can do the same, you just need to give it a default if a is nil | 2017-12-08T14:30:15.000618 | Sandy |
clojurians | clojure | (transient (or a {})) | 2017-12-08T14:30:22.000138 | Sandy |
clojurians | clojure | Thanks noise, I think good tests can do that too. But that still wouldn't be the same as telling a story about the project ... Or do you disagree? I think this kind of narrative usually gets put in the readme.
It also just occurred to me that I should be clear the narrative I had in mind is aimed at developing on the project not being a end user... Though you could probably use the same mental framework too construct one towards that end as well. | 2017-12-08T14:32:10.000631 | Glory |
clojurians | clojure | taking this to a thread as this is going to be a bit nit-picky -- the reason why I wouldn't reply "yes" to that question is that often people that don't really understand how nil is treated in the clojure stlib think that e.g `(merge nil {1 2})` works is because they think that `nil` can "act" as an empty collection of all types, when in reality that's only true in the case of seqs, and accepting that interpretation could be a bit confusing | 2017-12-08T14:32:14.000031 | Kareen |
clojurians | clojure | when the reality is that `merge` and other functions explicitely filter out nils or replace them with the appropriate empty coll, not that they know how to "interpret nil" as the correct empty coll | 2017-12-08T14:33:12.000047 | Kareen |
clojurians | clojure | <@Kareen>: I see, thanks for the clarification. This is precisely the mental model mistakes I was making. | 2017-12-08T14:33:59.000348 | Berry |
clojurians | clojure | <@Berry> another possible version (not so sure it’s an improvement but it lets me demo transduce) ```(defn merge-drop-vEmpty
[a b]
(transduce
identity
(fn
([] (transient (or a {})))
([v] (persistent! v))
([old [k v]]
(if (contains? #{nil {}} v)
(dissoc! old k)
(assoc! old k v))))
b))``` | 2017-12-08T15:11:39.000609 | Margaret |
clojurians | clojure | I do like the fact that it has a completing arity instead of needing the completion function to wrap the call | 2017-12-08T15:11:59.000503 | Margaret |
clojurians | clojure | but using identity as an xform makes me think this might be silly | 2017-12-08T15:12:23.000453 | Margaret |
clojurians | clojure | oh wait we could skip a bunch of BS by just using into here, because into already does the transient/persistent! thing for you | 2017-12-08T15:13:20.000267 | Margaret |
clojurians | clojure | hmm… | 2017-12-08T15:13:32.000131 | Margaret |
clojurians | clojure | but you can’t edit the first arg to into | 2017-12-08T15:13:50.000412 | Margaret |
clojurians | clojure | <https://dev.clojure.org/jira/browse/CLJ-2282> | 2017-12-08T16:32:07.000350 | Kareen |
clojurians | clojure | feel free to vote | 2017-12-08T16:32:12.000031 | Kareen |
clojurians | clojure | I was actually never sure if `(merge nil {:a 1})` working was reliably supported behavior | 2017-12-08T16:50:25.000382 | Petronila |
clojurians | clojure | The doc string does not indicate that it should work | 2017-12-08T16:50:31.000179 | Petronila |
clojurians | clojure | It is fairly annoying to not utilize it though at times | 2017-12-08T16:50:47.000424 | Petronila |
clojurians | clojure | ```
clojure.core/merge
([& maps])
Returns a map that consists of the rest of the maps conj-ed onto
the first. If a key occurs in more than one map, the mapping from
the latter (left-to-right) will be the mapping in the result.
``` | 2017-12-08T16:51:07.000280 | Petronila |
clojurians | clojure | that description seems to imply it shouldn't in fact | 2017-12-08T16:52:17.000054 | Aldo |
clojurians | clojure | because
```
(conj nil {:a 1})
=> ({:a 1})
(merge nil {:a 1})
=> {:a 1}
``` | 2017-12-08T16:52:26.000110 | Aldo |
clojurians | clojure | it is supported, but yeah it makes somethings difficult | 2017-12-08T16:52:55.000469 | Guillermo |
clojurians | clojure | <@Aldo> good point | 2017-12-08T16:52:58.000218 | Petronila |
clojurians | clojure | merge uses conj internally, but protects against nil | 2017-12-08T16:53:23.000189 | Guillermo |
clojurians | clojure | Just because a fn happens to do some behavior with nil now, doesn’t give me a lot of confidence that I’m not relying on an impl detail | 2017-12-08T16:53:31.000464 | Petronila |
clojurians | clojure | I wish it’d be in the docs for these sorts of edge cases | 2017-12-08T16:53:47.000240 | Petronila |
clojurians | clojure | There are plenty of cases like this though. The `merge` one is just one I’ve wrestled with in my head a few times. | 2017-12-08T16:54:29.000116 | Petronila |
clojurians | clojure | Also, I’m thinking it’d be a pretty harsh change to have `merge` stop supporting this behavior - so not likely to change anymore :stuck_out_tongue: | 2017-12-08T16:54:56.000219 | Petronila |
clojurians | clojure | core specs will help with this, can almost guarantee it won't go in the docstring | 2017-12-08T16:54:58.000326 | Guillermo |
clojurians | clojure | merge supports a couple other surprises, see the last comment in <https://dev.clojure.org/jira/browse/CLJ-1458> | 2017-12-08T16:55:34.000252 | Guillermo |
clojurians | clojure | I feel like if a spec is added to merge that says (s/nilable m) then a subsequent docstring PR that clarified what happened in the case of nil would prob be accepted | 2017-12-08T16:56:08.000215 | Aldo |
clojurians | clojure | <@Guillermo> good point on the core.specs. I just took a look over at that (haven’t looked in a while). It still has a lot more functions to cover still right? At least from what I see so far. | 2017-12-08T16:57:05.000269 | Petronila |
clojurians | clojure | It's mostly the main macros right now, <@Sonny> has more stuff pending somewhere, and there are a couple of github users that have their own specs of core | 2017-12-08T16:58:17.000152 | Guillermo |
clojurians | clojure | ah ok | 2017-12-08T16:58:31.000276 | Petronila |
clojurians | clojure | generally clojure docstrings don't comprehensively specify edge-cases, but <http://clojuredocs.org|clojuredocs.org> or whatever the thing-du-jour is certainly can | 2017-12-08T16:59:22.000149 | Guillermo |
clojurians | clojure | "Someone should" add an API to third-party clojuredocs and integrate them with tooling | 2017-12-08T17:00:35.000234 | Guillermo |
clojurians | clojure | I’m typically ok with that idea | 2017-12-08T17:01:28.000348 | Petronila |
clojurians | clojure | Then other times I have a hard time deciding whether I’m relying on an odd impl detail or not | 2017-12-08T17:02:18.000203 | Petronila |
clojurians | clojure | hah :stuck_out_tongue: | 2017-12-08T17:02:22.000389 | Petronila |
clojurians | clojure | Interesting Jira though, read through the CLJ-1458 one | 2017-12-08T17:02:45.000016 | Petronila |
clojurians | clojure | The stricter interpretation you take of the doc strings, the less likely you are to be relying on an odd impl detail. | 2017-12-08T17:05:39.000281 | Micha |
clojurians | clojure | I know that is still pretty vague advice, but at least in the case of merge, if you never pass it nil, you are safe. If you do, maybe it could return anything at all or raise an exception in Clojure 1.13 | 2017-12-08T17:06:53.000469 | Micha |
clojurians | clojure | Not saying it is likely, given the backwards compatibility effort Rich et al put into Clojure. | 2017-12-08T17:07:40.000093 | Micha |
clojurians | clojure | <@Micha> yeah, and I’ve found myself a few times being defensive about it out of that sort of worry
```
(update x merge {:a 1}) ; not this
(update x (fnil merge {}) {:a 1}) ; this
``` | 2017-12-08T17:07:56.000174 | Petronila |
clojurians | clojure | that sort of thing | 2017-12-08T17:07:58.000089 | Petronila |
clojurians | clojure | I then just start to wonder if it is worth the nil-guarding efforts | 2017-12-08T17:08:16.000257 | Petronila |
clojurians | clojure | and (generally) the more the docstring promises, the narrower a future path might be | 2017-12-08T17:08:25.000140 | Guillermo |
clojurians | clojure | the trade-off, make more verbose code to not rely on things vs hope for the best, but be prepared for potentially more difficult upgrades in the future | 2017-12-08T17:09:07.000356 | Petronila |
clojurians | clojure | and perhaps watch the Jiras carefully and fight for whatever obscure use-case you see that someone is about to break :stuck_out_tongue: | 2017-12-08T17:09:29.000230 | Petronila |
clojurians | clojure | I’m not saying what is right vs wrong here. Just explaining my internal conflict and struggle | 2017-12-08T17:09:49.000121 | Petronila |
clojurians | clojure | <@Petronila> total aside: that update could just use assoc ```=> (assoc nil :a 0)
{:a 0}``` | 2017-12-08T17:10:02.000188 | Margaret |
clojurians | clojure | <@Margaret> hah thanks, I didn’t intend to make something realistic | 2017-12-08T17:10:17.000487 | Petronila |
clojurians | clojure | that’s what makes it an aside haha | 2017-12-08T17:10:27.000107 | Margaret |
clojurians | clojure | wasn’t a great example :stuck_out_tongue: | 2017-12-08T17:10:27.000330 | Petronila |
clojurians | clojure | (and `nil` in merge is only problematic in the first argument) | 2017-12-08T17:10:33.000115 | Guillermo |
clojurians | clojure | oooh `(fnil merge {} {})` is also valid though | 2017-12-08T17:10:58.000193 | Margaret |
clojurians | clojure | What is a spec for `merge`? | 2017-12-08T17:11:47.000473 | Guillermo |
clojurians | clojure | at least the :args part | 2017-12-08T17:12:01.000293 | Guillermo |
clojurians | clojure | and ignoring the GIGO cases | 2017-12-08T17:12:18.000006 | Guillermo |
clojurians | clojure | it’s one of my pet clojure style issues, I just had to say something, I compulsively replace calls to merge that use a map literal as a second arg with calls to assoc (or instruct co-workers to do so when doing code reviews) | 2017-12-08T17:12:56.000062 | Margaret |
clojurians | clojure | seems like `if-not` could just ditch the expansion with `not` i.e.
```
(defmacro if-not
([test then] `(if ~test nil ~then))
([test then else] `(if ~test ~else ~then)))``` | 2017-12-08T17:18:44.000155 | Deandrea |
clojurians | clojure | right, it’s just `if` with the args flipped. | 2017-12-08T17:19:09.000275 | Deandrea |
clojurians | clojure | minor thing. | 2017-12-08T17:19:23.000096 | Deandrea |
clojurians | clojure | shouldn't m0 be nilable? | 2017-12-08T17:22:06.000023 | Kareen |
clojurians | clojure | nope, that's the GIGO | 2017-12-08T17:22:14.000461 | Guillermo |
clojurians | clojure | what is GIGO? | 2017-12-08T17:22:30.000180 | Deandrea |
clojurians | clojure | garbage in garbage out | 2017-12-08T17:22:36.000495 | Guillermo |
clojurians | clojure | ah, I thought you were speccing the current behaviour :) | 2017-12-08T17:22:41.000172 | Kareen |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.