This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-29
Channels
- # announcements (1)
- # babashka (15)
- # beginners (37)
- # calva (94)
- # cider (3)
- # clj-kondo (17)
- # cljsrn (2)
- # clojure (45)
- # clojure-europe (39)
- # clojure-germany (1)
- # clojure-norway (2)
- # clojurescript (16)
- # component (18)
- # conjure (1)
- # cursive (13)
- # datalevin (3)
- # datomic (12)
- # docker (2)
- # duct (5)
- # eastwood (2)
- # emacs (4)
- # events (8)
- # fulcro (8)
- # inf-clojure (5)
- # kaocha (8)
- # lsp (24)
- # malli (11)
- # meander (3)
- # off-topic (19)
- # polylith (11)
- # remote-jobs (4)
- # sci (61)
- # shadow-cljs (9)
- # spacemacs (34)
- # sql (10)
- # tools-deps (27)
- # xtdb (9)
Only 505 more core functions to go… lol 🙂 https://github.com/Zelex/jo_lisp
Cool project, I love seeing more Clojure in more place. But I have to ask, since it is interpreted, I'm not sure how you plan to achieve faster performance than JVM JIT Clojure?
For example, take Python and Ruby, both have really advance C implementations of their interpreter, and yet the Java versions tend to be faster, because the JVM JIT is just that good.
Sidenote: Was beginner really the channel you wanted to announce this in? There's a #announcements channel which would seem a better place.
I think you can’t turn it off directly, but you can configure logging to not include entries from Jetty. I think Jetty uses SLF4J, so you should configure this. Do you know how your logging stack looks like? A popular choice is to use logback, then you can configure which levels to log for certain loggers, and can mute Jetty
does clojure have destructure syntax for maps that will let me destructure 1 kv pair and refer to the rest of the kv pairs in another map?
you already have the rest of the kv pairs as a reference to original map
but I would like if I could get a new map without the kv pairs I've pulled out
(let [{a :a & rest} {:a 1 :b 2 :c 3}] ...)
doesn't seem to work.
there is no such operation map destructuring but you can be more explicit and write something like that:
(let [{a :a :as m} {:a 1 :b 2 :c 3}
rest (dissoc m :a)]
...)
I guess that'll have to do. Thank you.
maps are unordered so this doesn't make sense - you could get any kv pair
I'm not sure why it would require ordering. It would just be sugar for the above. Patterns and destructing are just to my knowledge sugar too.
the destructure pattern you asked: & binding
is a synonym to (rest ...)
which applicable only to ordered data structure
is that a language/implementation limitation tho? or just a convention limitation
rest function is rest function. you can't suddenly give it another meaning which you have to in case unordered data structure.
I was more alluding to it possibly being an extension to let
or a change to how &
expands
People have built utils for this, it comes up once in a while. I can't remember them though 😛
Hello, how can I directly add as a dependency to a lein project a specific github repo at a particular branch or commit? https://clojurians.slack.com/archives/CLDK6MFMK/p1651220427757339?thread_ts=1651220020.065459&cid=CLDK6MFMK
leiningen can't have git-based dependencies. You can try using some plugin that does that - https://github.com/tobyhede/lein-git-deps
For your own development environment you could add a deps.edn file with the project dependencies and use Clojure CLI to run the REPL with hotloading. https://practical.li/clojure/alternative-tools/clojure-cli/hotload-libraries-editor.html The project code should not care if the REPL is run with Leiningen or Clojure CLI (unless using a Leiningen plugin that injects application code - e.g lein-ring)
Hmm, I'm not too familiar with much of that, lemme try to understand: 1. From a high level, since this is a library I'd like to add to my work project, but likely cannot do so if I also had to add lein plugins, your suggested method is a personal, local stopgap until the next version of the lib is released, right? 2. Though it's a good learning experience, I've never actually run any clojure REPLs outside of using my IDE's jack-in with my work project's lein build/aliases/profiles or whatever. a. But since I don't know when the lib might next release, learning this might take less time anyways I guess! b. I will look into this 3. I'm not an expert on what our setup looks like, but I do know it's a Lein Monolith monorepo, idk if that injects anything Thanks!
1) suggested local setup as it was implied the project had restrictions as to what could be contributed
I have added a simple deps.edn
config file to work with a more monolithic project previously, allowing me to add on just the libraries I need to work on that project
2) There is a relatively small learning curve to Clojure CLI. There is a project called depify that can generate a deps.edn file with the same dependencies as the project.clj file (although not the profiles or aliases)
Clojure CLI has aliases but not profiles. Aliases can be composed together when starting a REPL via the editor to make a variety of "profiles".
The editor should detect Clojure CLI deps.edn config file in the root of the project (it may ask you to choose if it finds both)
3) sounds complicated. A monorepo can add complexity in general, although if organised well it should not have too... Depends how much thought went into the design.
I has such a project and spent days trying to get it to work, eventually adding a deps.edn file to stop Leiningen configuration doing something I didn't understand.


Perhaps a simpler approach is to clone the git repository you want as a dependency, check out the preferred branch and commit, then build an uberjar from that with lein jar
and install that jar locally with lein install
An existing jar in the .mvn/repository may need to be deleted or the version changed in project.clj if Leiningen is not using the jar you built and installed.
I like the sound of that second one haha. I really appreciate your taking and interest and helping out man!!
Do we have a good tutorial on how to produce (DOs and DONTs) and publish libraries to clojars?
actually sorry, I think this is right what I need: https://clojure.org/guides/deps_and_cli#_using_git_libraries