This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-23
Channels
- # announcements (1)
- # asami (2)
- # aws (15)
- # babashka (4)
- # beginners (42)
- # calva (8)
- # clj-kondo (7)
- # cljsrn (31)
- # clojure (64)
- # clojure-australia (4)
- # clojure-europe (40)
- # clojure-italy (2)
- # clojure-nl (5)
- # clojure-uk (10)
- # clojured (1)
- # clojurescript (16)
- # conjure (4)
- # datomic (5)
- # defnpodcast (2)
- # events (1)
- # fulcro (61)
- # graphql (11)
- # honeysql (9)
- # jobs (3)
- # jobs-discuss (3)
- # lsp (65)
- # malli (3)
- # meander (4)
- # off-topic (5)
- # pathom (32)
- # podcasts-discuss (2)
- # polylith (2)
- # re-frame (30)
- # reitit (6)
- # remote-jobs (3)
- # ring (4)
- # shadow-cljs (19)
- # sql (28)
- # vim (1)
- # xtdb (21)
Something like this @zackteo? https://github.com/seancorfield/usermanager-example/ That's a bit more than just Ring + Compojure but it's a small working app with a DB.
That works! Probably a bit more complicated compared to what I need but should be okay
Feel free to DM me if you have any Qs about it.
Or ask them here.
Having some difficulty in understanding what I need to do to get a POST working and how to go about checking it. Should I be writing my response as json with clojure.jata.json/write-str
I don't understand what you're asking here, sorry.
@zackteo If you need something even more basic, you can omit compojure completely and build your own router as demonstrated here: https://github.com/kloimhardt/babashka-scittle-guestbook
Thank you! @U04V15CAJ
does this function already exist? does it have a conventional name?
(defn f
[g]
(fn [x] (g x) x))
g
side effectsnice, this is it
Hey everyone, I have a problem with require one my files to another ont in the same project. this is how the project looks like :
.
├──src\c\g
└── do_lib
├──views
└── home.clj
└── assets.clj
the ns of assets.clj is: (ns c.g.do-lib.assets)
I want to require the assets file in the home file so I did: (:require [c.g.do-lib.assets :as assets])
when I try to eval the home ns I'm getting a syntax error Class Not Found Exception
then windows path of home.clj file directory on my computer then c.g.do-lib.assets
.
other requires that been imported don't make a problem.
what did I miss ?
thank you :)by mistake - things change here - let me change it back
hard to tell which is a typo in slack and which might be a typo in your source. c.g
vs co.g
what's the ns did you put in home.clj
? from the dir tree it should be (ns c.g.do-lib.views.home)
Syntax error (ClassNotFoundException) compiling at (c:\Users\..\my-pro\src\c\g\do_lib\views\home.cljc:0:0). c.g.do_lib.assets
the ns I used for home.clj
is (ns c.g.do-lib.views.home)
just double check that namespaces have dashes, and the corresponding files/dirs have underscores
ah, good point. in your tree output it is with a hyphen and in the copied error it has an underscore. These copy paste mistakes can make diagnosing issues quite difficult
the tree output shold look like the directory exactly?
in the directory name it is do_lib
but I changed it in the namespace to be do-lib.
so the dir name is already do_lib
before ghadi's suggestion?
maybe you haven't saved the file after changing the namespace?
hmm, have you tried to eval the home.clj file directly?
@myguidingstar - reopening and eval the file solved it. thank you all for the help 🙂
In the clojure core function sort-by
([keyfn ^java.util.Comparator comp coll]
(sort (fn [x y] (. comp (compare (keyfn x) (keyfn y)))) coll))
I'm not sure i understand the use of the dot here. I understand it to be related to java interopt. Is this a case of Member access ? e.g (.instanceMember instance args)*
(.instanceMember Classname args)* It's this one: `(. instance-expr (method-symbol args))`*
Calling the compare
method on comp, https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T-
ah ok, so comp here isn't clojures.core/comp. that was causing me some confusion
I was looking past the params