Fork me on GitHub

How do I check source of a dependancy for deps.edn or project.clj being used? I had several (parts of core.typed) downloaded through :mvn/version. Now I changed deps.edn to use :local/root (a git clone of the same). However, some of the dependencies refer to others, so I also changed their deps.edn. To double-check, is there a way to recursively list sources of all dependancies, please?


with a lein project you can do lein deps :tree


oh, after re-reading I realized that I didn't fully understand what you wanted to accomplish - lein deps does not do what you want. sorry about that


@peter.kehl Are you looking for clj -Spath ?


Thank you @seancorfield and @trailcapital. Yes, clj -Spathlists all dependancies.


-Stree not -Spath


-Spath tells you exactly which files are in your class path but, yeah, -Stree will be much more readable and tell you which versions you are using.

Vincent Cantin16:12:06

Hi. I am wondering if there is somewhere in the standard library a function to convert a set into a map, similar to:

(defn set->map [s]
  (into {} (map (fn [k] [k true])) s))


Alternative implementation:

(defn set->map [s]
  (zipmap s (repeat true)))


are you sure you need that? it encodes the same information and even the invocation would be the same (if (#{:a} :a) ..) is identical to (if ({:a true} :a) ..)


but if you do actually need this this seems like the best way to achieve it although it might be faster if you slip the s out of the map form so it uses a transducer version. Into will user transients in this case

Vincent Cantin16:12:43

The library that I am using requires a map and does not work with a set.


which library? this sounds like a strange mismatch (if you don't mind me looking)

Vincent Cantin16:12:28

That library I am using it for my lein template.


I'm curious how/where Stencil requires a hash map instead of a set @U8MJBRSR5?


Presumably it's in a mapping of variable to replacement text in the template

Vincent Cantin05:12:33

Yes, that’s for the data used to populate the templates.

Vincent Cantin05:12:40

From the template, I cannot simply test if a key is present in a set, stencil requires you to have key-value pairs.


OK, gotcha. I did a test and was a bit surprised that you couldn't test some-set.member in Stencil. That seems like a bug to me.


But I would need to test how it works in Selmer as well before really deciding it's a bug πŸ™‚

Vincent Cantin06:12:19

Sets may not be in the specs of Mustache.


Sets works in Selmer


user=> (use 'selmer.parser)
user=> (render "{{set.a}}" {:set #{:a}})
user=> (render "{% if set.a %}yes{% endif %}" {:set #{:a}})


That doesn't work in Stencil.

Vincent Cantin16:12:43

It feels like a function like set->map may exist under a different name somewhere, I would like to make sure that I am not duplicating code.


if it did it would be identical to yours. it requires information (what to map each key to) so there's none with the signature you have but would be similar to what you have there. but this seems like a very nonstandard thing. and in this case the standard library gives you the building blocks to make what you need concisely. and in this case it is a one liner πŸ™‚

πŸ‘Œ 4
πŸ‘ 4

dammit... so I asked this before and I don't remember the answer and Google is still not being helpful.... I deleted the contents of my .m2 directory, and now when running clj I get Error: could not find or load main class clojure.main. I know there is a simple command to correct this, and I can't for the life of me find it again πŸ˜• Anyone remember?


nevermind.. found it... clj -Sforce


it's only the 11th option down in the clj manpages for dep-opts.. I missed it the first 5 times I read through.. it's going to be a long day haha

πŸ˜… 4

Hi I have a rum and react question. I want to serverside render some components. I have cljs code in the :on-click events and therefore ... i can throw them all into a cljc and selectively render via reader conditional, or i can just strip out the js myself on the serverside code... problem being that my (rum/hydrate (component)) is not overwriting the component and not giving it the javascript from the client. tricky getting to the bottom of


Nevermind I got all that jazz working ^.^


But, I don't know how to extract keys from my ajax-resp using ajax-lite


Logging in with username vskill
Ajax login response: {:raw-resp #object[Object [object Object]], :xhr #object[Object [object Object]], :success? true, :?status 200, :?content-type "application/octet-stream", :?content "[:uid \"vskill\"][:login-time 1545599249][:auth-token \"AYag$C7dYUulnMTw=$fEY5fv7BfKvgZePQGtOMd/eLKRI=\"]", :?error nil}
Login successful
contents of success map: 
auth token is
login time is


trying to indicate login-time via (:login-time ajax-resp) doesn't work because the response body looks like...


[:uid "vskill"][:login-time 1545599249][:auth-token "AYag$C7dYUulnMTw=$fEY5fv7BfKvgZePQGtOMd/eLKRI="]


how can I get :uid and the rest from something that looks like that? Can i mess with Content-Type to get json back?


What's the EDN Content-Type ?


no idea how to get what I want from {:raw-resp #object[Object [object Object]], :xhr #object[Object [object Object]], :success? true, :?status 200, :?content-type "application/transit+json", :?content "", :?error nil}


how do I make use of :raw-resp?


it comes back as a sequence of vectors [:key val] [:key val] [:key val] and clojurescript thinks it's a string.


I did (type ajax-resp) and got Function...


am i a newb or is shit just overly complected


Are all the parts tightly coupled and dependant on each other in a web of interwoven effects? If so, it would be complected. But it sounds to me like it's just that you are unfamiliar with it, though clearly it's not self explanatory or obvious, since you struggled with it. But having not used Rum or ajax-lite, I can't really say.


The Missing Link betwixt ajax-lite and cljs