This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-26
Channels
- # aleph (2)
- # beginners (119)
- # boot (18)
- # cider (19)
- # cljs-dev (46)
- # cljsjs (1)
- # cljsrn (30)
- # clojure (101)
- # clojure-dusseldorf (12)
- # clojure-finland (1)
- # clojure-greece (7)
- # clojure-india (2)
- # clojure-italy (6)
- # clojure-poland (4)
- # clojure-russia (120)
- # clojure-sg (3)
- # clojure-spec (147)
- # clojure-uk (75)
- # clojurescript (86)
- # cursive (4)
- # datomic (50)
- # docker (1)
- # emacs (4)
- # juxt (51)
- # leiningen (16)
- # liberator (1)
- # luminus (1)
- # lumo (116)
- # mount (2)
- # off-topic (2)
- # onyx (38)
- # pedestal (4)
- # protorepl (2)
- # re-frame (44)
- # reagent (8)
- # ring-swagger (16)
- # schema (5)
- # specter (16)
- # test-check (226)
I'd like to know why the conn in {conn :conn {:keys [id]}... isn't placed inside the :keys [id] vector instead? In the following code: (helpers/defhandler todo-delete [{conn :conn {:keys [id]} :path-params :as req}] ...
In the next handler it is placed inside the :keys vector like so: (helpers/defbefore todo-delete-all [{{:keys [conn db]} :request :as context}] ... I am wondering what's the difference ?
Question: Is there a alternative keyboard layout that clojurians use?
@danielblack Why would you want a different keyboard layout? You can use whatever layout you like.
@danielblack - I like Colemak, but my choice isn't related (in any direct way) to my choice of Clojure.
@danielblack I've considered workman-dead as it puts programmer keys into homerow: https://github.com/ojbucao/Workman/tree/master/mac#workman-dead-for-programmers
lein uberjar
works locally, but not from within a Dockerfile,
Could not find artifact ...... in clojars ....
, I'd like it to pull in deps from a checkouts
link
For some reason when I run lein uberjar
from within a Dockerfile, it only looks for repos online and won't use anything I have locally.
That means it's slow to build, since it must retrieve every repo every time (and slow to debug)
And it won't grab my local-only deps...
any suggestions?
When you say "pull in deps from a checkouts
link" are you lein install
ing them first?
yes indeed, and I can see the correct version sitting in ~/.m2
have you run -v "$HOME"/.m2:/root/.m2
?
to mount your local m2 into the Docker's m2?
ah, no, is that a docker command?
(i'm new to docker)
Yeah, https://github.com/Quantisan/docker-clojure#clojurescript-development-with-figwheel
have a look at that run command
c.f. https://github.com/arohner/lein-docker/blob/master/src/leiningen/docker.clj#L136
checking it out now, it looks promising thanks!
(ps, thats amazing how you can always debug other peoples problems from afar)
hm, can't mount volumes during build
: http://stackoverflow.com/questions/26050899/how-to-mount-host-volumes-into-docker-containers-in-dockerfile-during-build#26053710
@not-raspberry @ska thanks for reply my question
@sophiago https://github.com/clojure/clojure-contrib/commit/19613025d233b5f445b1dd3460c4128f39218741
@stuartsierra I'm confused. This was committed in 1.3?
According to this map-utils just wasn't migrated over? https://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go
@sophiago It was a piece of old "clojure-contrib" that was not included in the migration.
It's been copied in various "utility" libraries since.
https://dev.clojure.org/jira/browse/CLJ-1468 is a ticket to add deep-merge to Clojure
Rich weighed in his opinions there, but no one has ever taken the next steps with it
variants are, yes
translating Rich-speak, it means there is no description of what “deep” merge actually means
the fact that there are variants is itself instructive - typically the variations are specifically around the points of ambiguity
I can understand to some degree. I'm thinking of numerous edge cases in how this would work myself.
merge
docstring says more, most importantly that it is conj-based.
conj is not a deep operation
so I think the question is, what does deep-merge mean in that context?
I think that’s a fruitful thing to talk about :)
lots of edge cases around absent/nil/empty colls
maps and vectors
having some example use cases helps with this
ticket has none of this
Welp, I suppose I'll see how much I end up needing to use it and whether I have any more thoughts that warrant putting together a version for a JIRA ticket. There are many edge cases in something like this. I was thinking it could be handled well similar to the specter library, but I was told it's not designed for working with multiple data structures. So adding this function to core would imply taking some stance on how it should behave and communicating that well.
or in Rich-speak, “solution thinking” - here’s some code, please add it rather than “problem-oriented thinking” that starts from a good description of the problem and consideration of alternatives
The dissoc-in ticket is similar https://dev.clojure.org/jira/browse/CLJ-1063
Right. That's why I liked specter's approach: it comprehensively addresses a structural problem Clojure has working with recursive data structures. But the solution there is quite heavy for anything I'd want to implement.
How would I quote the reference of an argument? So in other words: (defn foo [x] (print 'x)) (foo bar) => x
whereas I want (defn foo [x] (print 'x)) (foo bar) => bar
might someone possibly remind me, why can we drop the org
or com
prefixes from our package names these days?
Regarding clojure.core.reducers
, I’m curious why, given an expensive function f-heavy
, you get a speedup with (pmap f-heavy coll)
but not with (fold reducing-fn-that-calls-f-heavy coll)
? Assume coll is big enough that fold
should chunk/parallelize it
I never see that style used in professional clojure projects, but I still use it for my personal projects. Most professional projects are for businesses with a name that works well enough for avoiding collisions, but just using my name for personal projects seems weird.
the reverse domain name style is the one I use for personal projects, but don't see used in projects that I get paid to work on
because I want some prefix that precludes collisions of names, and domain names sort of do that because there can be only one owner of a domain at a time
well, I may not always and forever own a domain, so ideally names would refer to a domain for the time period in which it is mine
and then later we re-introduce what is missing e.g. clojure.spec adding validations for function inputs. Sometimes it occurs to me that if the idea of type safety had been reduced to validations rather than tossed away, we might have had good validations api much, much earlier on
Is anyone using some form of protobuf with Clojure these days? I’m trying to figure out which library to use. It seems like there’s a few different forks out there as well as a lein-protobuf plugin, but none of them seem to be working properly / maintained
Yeah, it looks like there’s a billion different forks of each project, so I’m not sure what’s going on here. It certainly seems like the original maintainers have moved on several times over
Part of me wants to just fork the project and make it work for me
The other part of me wants to just start from scratch and do it right, but that seems to be far more work than I’m interested in at the moment. What’s your situation?
The immediate need isn't there for me. I'm just trying to scope out potential options just in case.
Why not just use the original java libraries? it will also bypass any bugs introduced by clojure wrappers
Does anyone know of any languages provided a type system that can do something like spec does. i.e. Granularity, flexibility, and expressiveness using predicates.
spec is inspired in part by Racket’s contract system
@alexmiller Sorry. I wasn't particularly clear. I was looking for something that does expressive types(contracts) at runtime.
@nbardy compile-time and "predicates" are fairly hard to combine. Does long?
unify with int?
perhaps, but what about long?
and customer-id?
. Predicates are very open-ended and allow you to leverage a entire language. That doesn't fit very well with static analysis. About the best you can do is write specialized checks for "blessed" predicates
for example it would be possible to perform static analysis on s/keys
but if someone wrote their own version of s/keys
it'd be very hard to write a static analysis system that could pick up that m/my-keys
could unify with a s/keys
Dialyzer? I don't know enough about it
people have written spec inference things, which use static analysis to generate specs (rather than static analysis checking specs)
right, but I'd imagine even those fall apart with a sufficiently complex predicate.
your spec is: any?
if I want to zip with applying function to each element, how would I do this? e.g. have [1 2 3]
want to zip into something that say multiples each key by 2: {1 2 2 4 3 6}
I can use reduce, maybe there’s nicer, elegant way? I think Haskell’s zipWith
does something like that
@ag (zipmap x (map (partial * 2) x))
^^^ in most cases I would probably still use reduce
so that the program only walks the collection once (`map` will walk x
once to apply partial, zipmap
will walk that output along side x
to create the final map). Probably a very very minor performance/memory performance between the two though
As usual, I forget the transducer approach. Yeah, that would be better. Although [i (* 2 i)]
was what @ag asked for.