This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-15
Channels
- # announcements (1)
- # babashka (1)
- # beginners (43)
- # cider (2)
- # clj-kondo (29)
- # clojure (61)
- # clojure-austin (18)
- # clojure-dev (7)
- # clojure-europe (30)
- # clojure-nl (1)
- # clojure-norway (23)
- # clojure-uk (5)
- # clojuredesign-podcast (8)
- # cloverage (1)
- # conjure (1)
- # data-science (1)
- # datahike (36)
- # datavis (1)
- # datomic (23)
- # emacs (14)
- # hyperfiddle (28)
- # lsp (5)
- # missionary (1)
- # music (1)
- # off-topic (11)
- # re-frame (11)
- # reitit (5)
- # releases (1)
- # shadow-cljs (65)
- # spacemacs (13)
- # squint (33)
- # tools-deps (56)
Well, this definitely falls into the “thanks, I hate it” category for me but, uhhh, enjoy…
(defmacro infix-children [form]
(for [f form]
(if (list? f)
`(infix ~f)
f)))
(defmacro infix [form]
(if (list? form)
`(infix-children
~(if (= (count form) 3)
`(~(second form)
~(first form)
~@(drop 2 form))
form))
~form))
(infix (1 + ((5 - 2) + ((- 10) + 10))))
(infix ((1 / 2) + 2))
(infix (println (1 + (5 - 2))))
Ah, I forgot I changed it to only affect lists with exactly 3 elements… obviously the drop 2 business could just be (nth form 2)
now.
It gets weird fast. Like, if there’s a hash map, should we walk the whole thing to find things to infix?
I think I’ll just stick with my prefix notation. 😉
Fun meetup last night! I enjoyed the show-and-tell format and always love seeing other people’s tools! I’m glad we all gave our hearts to Clojure and could make it out for a special V-Day meetup, haha.
Here are some resources for stuff I mentioned last night:
• clojure.core/iteration
(since 1.11) https://clojuredocs.org/clojure.core/iteration
• clojure.core/requiring-resolve
(since 1.10) https://clojuredocs.org/clojure.core/requiring-resolve
• Mark joked about a generalized version of (Common Lisp’s) prog1
(which I called
returning
in Clojure)
◦ I did this once, just for kicks: https://camdez.com/blog/2011/01/09/ruby-implementing-progn-from-lisp/#and-beyond
• Reitit (esp. middleware compilation: https://cljdoc.org/d/metosin/reitit/0.7.0-alpha7/doc/ring/compiling-middleware)
• Portal https://github.com/djblue/portal
• better-cond https://github.com/Engelberg/better-cond
• Binding conveyance https://clojure.org/reference/vars#conveyance
• Hiccup compilation https://tonsky.me/blog/hiccup/#how-hiccup-works
• ClojureScript macros (written in Clojure!) https://code.thheller.com/blog/shadow-cljs/2019/10/12/clojurescript-macros.html
• map-of
macro https://github.com/metosin/potpuri/blob/d5294910d33147279b94152f1b4a5df907d75c6f/src/potpuri/core.cljc#L72-L77
• We collectively touched on...
◦ Rama https://blog.redplanetlabs.com/2023/10/11/introducing-ramas-clojure-api/
◦ Apache Samza https://samza.apache.org/
◦ Also possibly interesting
▪︎ Apache Flink https://flink.apache.org/
▪︎ Materialize https://github.com/MaterializeInc/materialize
• Instaparse https://github.com/Engelberg/instaparse

Very romantic. But I agree-- this format was a good way to fill a Meetup when we didn’t have a pre-arranged topic/speaker.
We could also do a collective try out some new tool meetup. Live coding isn’t so bad among friends.
Ah, that is nice. Mine is simple:
(defmacro returning
"Evaluate `body`, presumably for side effects, and return `v`. Like
Common Lisp's `prog1`."
{:style/indent 1}
[v & body]
`(let [v# ~v]
~@body
v#))
Nice to be able to not name the value through the magic of anaphor.I really wish we had a quasi-quote that didn’t resolve all symbols. Odd to me that there isn’t one.
That’s where I want it right now. 🙂 Yes, I think I’ve seen that. Didn’t really want to pull in something just for this.
i think that’s what we did as well. Each instance we thought “no need for a library for just a single query” but we said it 35 times … so not sure it is valid in the aggregate
Not being able to easily mix in evaluatable symbols in my quoted Datomic queries is definitely a hassle. The :in
syntax is sometimes funky and feel verbose. I always wished I could do something like this:
'[:find ?foo :where [?foo :my/attr ~x]]
But you can only inline with the syntax-quote (“`”), which would break the rest of datomic query.