This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-23
Channels
- # announcements (2)
- # babashka (56)
- # beginners (30)
- # calva (79)
- # cider (5)
- # circleci (3)
- # clj-kondo (84)
- # cljfx (2)
- # cljsrn (3)
- # clojure (264)
- # clojure-czech (3)
- # clojure-europe (18)
- # clojure-spec (3)
- # clojurescript (12)
- # conjure (28)
- # cursive (5)
- # datomic (4)
- # deps-new (22)
- # fulcro (6)
- # graalvm (3)
- # jobs (1)
- # malli (1)
- # off-topic (23)
- # pathom (4)
- # portal (3)
- # practicalli (2)
- # quil (6)
- # reagent (20)
- # remote-jobs (3)
- # reveal (14)
- # ring (10)
- # shadow-cljs (5)
- # spacemacs (4)
- # xtdb (4)
In Datomic’s pull syntax, is there a way to (pull ?e [*]) but exclude a specific key, say :db/id or a number of keys?
(yes, I can transform the data recursively after I receive it, but wondering if there’s a nicer way)
Why do I get here that the home-handler is unused where there is one
(defn home-handler
[request]
(let [page (extract-page-number request)]
(future (memo-display-data (inc page))
(-> (memo-display-data page)
(display/generate-html page)))))
(defroutes app
(GET "/" home-handler)
(route/resources "/")
(GET "/favicon.ico" [] ""))
and what can be the reason for this error message : HTTP ERROR 500 java.lang.NullPointerException: Response map is nil URI:/ STATUS:500 MESSAGE:java.lang.NullPointerException: Response map is nil SERVLET:- CAUSED BY:java.lang.NullPointerException: Response map is nil Caused by:
java.lang.NullPointerException: Response map is nil
at ring.util.servlet$update_servlet_response.invokeStatic(servlet.clj:100)
at ring.util.servlet$update_servlet_response.invoke(servlet.clj:91)
at ring.util.servlet$update_servlet_response.invokeStatic(servlet.clj:95)
at ring.util.servlet$update_servlet_response.invoke(servlet.clj:91)
at ring.adapter.jetty$proxy_handler$fn__7287.invoke(jetty.clj:28)
at ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.base/java.lang.Thread.run(Thread.java:834)
Code so far : https://github.com/RoelofWobben/paintingsSeems like :keys
destructuring only works for let
and not for fn
arguments, is that correct? Seems like I cannot have a (map (fn [{:keys...} args])
Looks like I did something wrong. What if I also wanted the original map? (map (fn [{:keys [k]} m] ..)
(map (fn [{:keys [k] :as m}] (assoc m :a (inc k))) [{:k 1} {:k 2}])
({:k 1, :a 2} {:k 2, :a 3})
recommend checking the docs 🙂 https://clojure.org/guides/destructuringThanks @U751SU53R , I actually checked the docs but I missed the :as
part (which isn't needed for let
can you clarify what you mean by "isn't needed for let
"? e.g. (let [{:keys [a b] :as m} (invoke-some-fn)] ..body)
oke, I got a project work with hiccup What is now a good way to learn to do the front-end with reagant or re-frame ?
One cool thing I've found with hiccup / reagent is that hiccup form can generate other times of XML like SVG. https://github.com/Aeyk/clojure-scratchpad/blob/master/opus_flammagramma.svg Was generated with hiccup code, for instance
re-frame has a bunch of other moving parts, since it has a philosophy on memory management and such. I recommend starting a simple project from scratch before trying to port this one. (don’t worry your knowledge of hiccup will help you quite a bit because reagent and re-frame also use a version of it) I’d probably recommend reagent first then maybe try re-frame. and this site is highly recommended for getting a quick overview with a bunch of examples: https://reagent-project.github.io/
Once you get a good grasp of how the template is set up and runs maybe you can try adapting your previous one to work with reagent as well. This might be very fast if you’ve used react before and understand the underlying concepts, otherwise it might take a bit of getting used to.
not a big problem, it’ll just take a bit longer to understand why they do certain things.
Eric Normand has some good videos on the basics of reframe and reagent. Jacek Schae has free and paid courses for both reagent and reframe, building an application starting from the ground up. Both assume no knowledge of react.
As mentioned earlier in the thread, you probably want to do reagent before reframe, since the latter is used on top of the former.
@U0105JJK1L3 so first this course : https://www.jacekschae.com/learn-reagent-free