This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (1)
- # announcements (9)
- # aws (6)
- # babashka (18)
- # babashka-sci-dev (25)
- # beginners (79)
- # calva (30)
- # cider (34)
- # clj-kondo (25)
- # cljsrn (6)
- # clojure (26)
- # clojure-australia (1)
- # clojure-europe (6)
- # clojure-norway (1)
- # clojure-poland (6)
- # clojure-uk (3)
- # clojured (2)
- # clojurescript (14)
- # datomic (19)
- # events (1)
- # google-cloud (1)
- # gratitude (2)
- # helix (1)
- # hyperfiddle (2)
- # interceptors (1)
- # jobs (17)
- # joyride (96)
- # leiningen (5)
- # lsp (20)
- # minecraft (2)
- # nbb (5)
- # other-languages (1)
- # re-frame (34)
- # releases (2)
- # shadow-cljs (15)
- # spacemacs (1)
- # xtdb (19)
Has anyone installed cljstyle from brew recently? I get the standard "we're Mac and you need to find the actual file and right click it since we don't know the developer"
Not brew but we (in our team) did not have any problem using installation script: https://github.com/greglook/cljstyle#installation-script-macos-and-linux
I want to create something like Python's
__init__ files that make it easier to import stuff.
My intention is to let users just do
(:use [everclear.api]) instead of
(:require [everclear.parse.create-user-ns :refer [defrule]]).
However, if I try to do
(ns everclear.api (:require [everclear.parse.create-user-ns :refer [defrule]]))
I get the error message
(:require [everclear.api :refer [defrule])
defruleis a macro btw. How do I allow users to import stuff from
I would strongly advice against doing that. See https://github.com/bbatsov/clojure-style-guide#prefer-require-over-use and https://stuartsierra.com/2016/08/27/how-to-ns.
If you want to make an API namespace that just gathers functions from other namespaces, just write wrapper functions.
I considered that at first. Wrote a wrapper macro 🙂 🙏 Thanks for steering me back on the right path.
Asking for a friend..... Is there a substantive difference between writing a wrapper function or doing something like:
I once used
(ns api (:require [that.which.i.wrap :as to_wrap])) (def crossed-beams? to_wrap/crossed-beams?)
potemkin/import-varsbut it confused some tooling. (I think
clojure.tools.namespacethat parses ns macros at the heads of files).
@U03E8292BBL Tooling which relies on static analysis won't see docstrings and arglists that way
Ummm, I’m doing something wrong? Does anyone know how to construct a keyword programatically that I can call against a map. I thought it would be simple, but I’m missing something. Here’s about what I’d like. Note, I’d like the namespace (get props ::component/keyword)
(get props (keyword (str ":component/" k))
::stuff is a reader construct, not a runtime construct. You have to use a full namespace.
Also, don't use
: when constructing a keyword - it'll become a part of the name or namespace.
And don't use string concatenation -
keyword has another arity for specifying namespaces.
You can still use a namespace alias though, but it will be indirect:
(keyword (namespace ::component/-dummy-kw) k)
cheers for the reply. I’m following you, but I’m not sure where to find the source so I can see this multi-arrity
if you want to resolve the alias into a full ns, you can do that on the namespace mappings of course
This is all very interesting. Thanks for the quick response. I’ve got it from here. CHEERS
Do you know any pure Clojure generic connection pool? Or should I just look at Apache Commons Pool? (https://commons.apache.org/proper/commons-pool/)
Using Commons Pool as a bit awkward but its def a good option, if you need a very robust solution. Otherwise a record with some internal state might be a simpler option
Yes, I know: https://github.com/tomekw/hikari-cp 😉 I'm looking for something generic, like "any TCP connection" pool
I'd vote against dirigiste. It may https://github.com/clj-commons/dirigiste/blob/master/src/io/aleph/dirigiste/Executor.java#L64 in some cases. There is an https://github.com/clj-commons/dirigiste/issues/12.