This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-02
Channels
- # announcements (3)
- # aws (8)
- # babashka (87)
- # babashka-sci-dev (3)
- # beginners (34)
- # calva (35)
- # clerk (2)
- # clj-commons (47)
- # cljdoc (10)
- # cljs-dev (21)
- # clojure (19)
- # clojure-android (1)
- # clojure-austin (2)
- # clojure-europe (30)
- # clojure-nl (1)
- # clojure-norway (67)
- # clojure-uk (9)
- # clojuredesign-podcast (7)
- # clojurescript (24)
- # code-reviews (20)
- # cursive (6)
- # datomic (12)
- # emacs (14)
- # events (1)
- # fulcro (7)
- # gratitude (1)
- # hoplon (8)
- # hyperfiddle (23)
- # juxt (22)
- # meander (11)
- # nyc (3)
- # overtone (2)
- # podcasts-discuss (1)
- # reagent (3)
- # releases (1)
- # sci (27)
- # shadow-cljs (73)
- # squint (4)
- # thejaloniki (3)
- # xtdb (7)
I'm learning some legacy Clojure code base in a new project. There is a lot of:
(def foo
{:compile (fn [...
I tried to find information about this :compile
keyword in def, but couldn't find much info about it. I guess this is some aot compilation stuff? foo
is used in some middleware processing. Is this necessary in some middleware processing? Why not just regular (defn foo [] ...
?{:compile (fn [...
has nothing to do with clojure compiler. This is just "define foo as a map with key :compile"
Reitit middlewares? If so, maybe it's about this? https://cljdoc.org/d/metosin/reitit/0.7.0-alpha7/doc/ring/compiling-middleware
Ah, of course. It's been more than a year since I have done anything with Clojure. Thanks. 🙂
Damn. I'm really ashamed of myself. A really rookie misunderstanding. Shame on you, Kari! 🙂
But I must say that I miss Clojure. Sometimes I ask myself that did I make a good choice switching Clojure to a considerably bigger pay check. 🙂
Hi @everyone! I’m interesting on Clojure and babashka. At this moment I’d like to create two different projects. Firstly I need to create an azure template generator following a specific pattern. The other project it’s a dashboard of azure boards and working items. In your experience what do you think about making that projects with clojure or babashka? Thanks for your time reading this!
bb is more limited but more light-weight (faster to start), if you run into a limitation you can still switch to JVM Clojure.
Thanks for the answers @U04V15CAJ! I’m really interested in the announcement of self contained binary for babashka. I’ll try to find the library’s or utils for start with generator and cli and ask in the bb channel if have doubts 😃
Does anyone know of any open source Clojure projects that a beginning dev might be able to fire up a REPL and learn their way into contributing? Maybe with some relatively low hanging fruit issues that may still need a bit of fiddling in the REPL to understand what is going on
I work on this tool called https://github.com/djblue/portal and there is this https://github.com/djblue/portal/issues/68 that could use some work. The code base isn't particularly small, but the issues should mostly be isolated to the https://github.com/djblue/portal/blob/master/src/portal/runtime/browser.cljc#L23-L32 namespace. The underlying problem is allowing users to specify the name of a binary of a chromium based browser to use instead of the default chrome.
Very cool! I've seen several Clojure talks about Portal. I'll check it out!
What’s the most idiomatic way to assert that a macro argument is always a Var?
Hmmm, yeah, I’m doing maintenance work on a legacy codebase and I do wish that first rule you mention had been followed more closely – that it depended on fewer custom macros.
I guess something like
(defmacro my-macro [v]
`(let [v# ~v]
(if-not (var? v#)
:not-a-var
...)))
could work. The reason for introducing v#
is just to make sure we don't evaluate the input expression v
more than once. If you know there's never any side-effects evaluating v
, then it's not strictly necessary.That’s an interesting approach, but the assert is executed immediately, not in a ns-quoted block I think the idea is to make ns loading fail the instant it tries to expand a macro with bad args
I guess then your macro must call eval
on it's arguments, and check if the result is a var or not.
I am really trying to understand the concept of functional core imperative shell. Does anyone have a good resource that demonstrates this?
but the basics is the the places in the code where you "make a choice" you don't do mutation or side effects
the places where you actually affect the world or need to gather information from the world, you go wild
since most programs are "talk to the world" -> "think" -> "talk to the world", that is a "shell" around "thinking"
(let [stuff (make-http-request client)]
(when (should-do-thing? stuff)
(save-to-database conn (shape stuff)))