This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-10
Channels
- # admin-announcements (21)
- # announcements (1)
- # boot (91)
- # cider (2)
- # cljs-dev (46)
- # clojure (77)
- # clojure-berlin (1)
- # clojure-czech (2)
- # clojure-dev (22)
- # clojure-france (2)
- # clojure-india (1)
- # clojure-japan (16)
- # clojure-russia (6)
- # clojure-uk (1)
- # clojurescript (195)
- # cloxp (2)
- # cursive (15)
- # editors (6)
- # jobs (10)
- # ldnclj (18)
- # liberator (3)
- # off-topic (2)
- # onyx (24)
- # re-frame (4)
- # reagent (57)
I implemented microKanren over the weekend
it made me wish that maps were defined recursively like lists are
I guess I mean that the tree structure is apparent
for instance (cons 1 x) is just a constructor
but (assoc x :a 1)
does some behind-the-scenes magic
the tree of the map is not revealed
still, microKanren is very cool and I recommend it
anyone have experience listing files in a subfolder in a jar?
in a way that works both inside a jar and outside. currently (-> “path” io/resource file-seq)
isn’t doing it
really would like to avoid (JarFile.)
and friends
would this do the trick? @robert-stuttaford
i suppose i could use that and filter it with regex. but this’ll be happening in an uberjar where LOTS of files will be on the classpath
ah, that lib appears to handle that
tx greywolve !
I have a weird problem. In IntelliJ I see the namespace ring.middleware.not-modified. Also I get autocompletion for it in Emacs. Yet my code results in an error about the class not being found.
Hello @borkdude, lein uberjar
works fine in a terminal? lein clean
and lein check
may help you.
hmmm I saw uberjar in the stacktrace, but now I see it's just one of your .clj files... nvm then
@shamatov: some suggestions:
Clojure for the Brave and True
Clojure from the Ground Up
Light Table, , and a few of Rich Hickey's talks, 4Clojure and Clojure Koans
Living Clojure is another book, by the same author as How I Start Clojure -
But if the issue was happening when running from your uberjar, the with-profile uberjar
would help to see if the ring jar was being excluded from your uberjar somehow
@borkdude: do you have :aot matchmaker.uberjar
or :main matchmaker.uberjar
? If yes, can you try removing it?
@borkdude: Cool, let us know. Also as others said, be sure it's not a caching issue: lein clean
but why not also manually clean in ~/.m2/repository
Am I correct in thinking that reduce
is the same as foldl
as mentioned here: https://en.wikipedia.org/wiki/Fold_(higher-order_function)#Folds_as_structural_transformations
apparently it is: https://en.wikipedia.org/wiki/Fold_(higher-order_function)#Folds_in_various_languages
The only case where is usefull in languages like clojure, is fold a lazy-seq into an other lazy-seq
http://funcool.github.io/cats/latest/#_foldable a little bit of explanation and implementation of generic foldl and foldr for few of clojure data structures
Is there any value gained in using an immutable map (over a mutable one) when some of the "values" in the map are themselves mutable (eg. an atom)?
Man, I can’t imagine a great reason to have a map full of atoms. That would need a good explanation.
Seems like we do it a lot. @stuartsierra's Components essentially require it, don't they?
Ah, so you mean a map referring to what amounts to a single instance? (like a db connection, or a connection pool, etc)
Well, in the Components example, you often have some immutable values in the map as well as some mutable ones.
I would think there’s still value there. You (probably) don’t want to loose your instance just because someone dissoc
s in the middle of a get-in
. I dunno, just my initial take.
I have used a lot the stuart sierra component model and almost never I have needed "mutable state" in the components
yes, but you should not set them in a atom. Just return a new transformed record in start
function
right. I'm referring to the mutability or side-effectful nature of the thing. An atom is one example, a socket is another.
Yeah, the atom can not be compared directly to the socket. But, in any case, the side-effects are inevitable...
@chouser Part of the motivation for 'Component' is to make working with mutable Java objects feel more like working with values. Although application code using components doesn't often care, the 'Component' library relies on it internally.
Although now that I think about it a bit, it could probably work with mutable maps as well.
stuartsierra: but beyond supporting use of mutable Java objects, the Component API requires, if a value in a component is to be updated, that it must be mutable.
This has caused me to be skeptical of Component for a while, during which time I've been looking for alternatives.
But I should say, since we're talking about it, that I've found nothing acceptable (to me) yet, and am using Component pretty widely at this point. So thanks, @stuartsierra, for putting something concrete out there!
@chouser: You're welcome! I've struggled with the same issue but never come up with a satisfactory solution.