This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-23
Channels
- # 100-days-of-code (1)
- # adventofcode (13)
- # aleph (1)
- # beginners (48)
- # boot (10)
- # calva (52)
- # cider (18)
- # cljsrn (23)
- # clojure (68)
- # clojure-uk (9)
- # clojurescript (5)
- # cursive (3)
- # datomic (4)
- # figwheel (7)
- # fulcro (14)
- # hoplon (2)
- # leiningen (5)
- # lumo (3)
- # off-topic (87)
- # overtone (5)
- # reitit (5)
- # rum (8)
- # shadow-cljs (7)
- # spacemacs (15)
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?
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 -Spath
lists all dependancies.
-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.
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))
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
The library that I am using requires a map and does not work with a set.
That library https://github.com/davidsantiago/stencil I am using it for my lein template.
I'm curious how/where Stencil requires a hash map instead of a set @U8MJBRSR5?
Yes, thatโs for the data used to populate the templates.
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 ๐
Sets may not be in the specs of Mustache.
Sets works in Selmer
user=> (use 'selmer.parser)
nil
user=> (render "{{set.a}}" {:set #{:a}})
":a"
user=> (render "{% if set.a %}yes{% endif %}" {:set #{:a}})
"yes"
user=>
That doesn't work in Stencil.
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 ๐
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?
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
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?
or edn? o.o
What's the EDN Content-Type ?
nvm ...
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...
Wow! finally..
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