Echoing back input in uppercase over a socket with Hy, a Python Lisp dialect
I wouldn't use the threading macro here. That's most useful when you want to see the data flow, but you're using c two times in this expression, there's no clear flow that -&gt; could make easier to untangle. It makes it more complicated in this case...

If you'd decouple the receive and the send part, then it'd be different, but then the expression becomes so simple you don't even need the macro:

(let [[received (.recv c 10000)]]
  (.send c (.upper received)))


With the threading macro, the inner part would become (-&gt; received (.upper) (.send c)) - doesn't make it much clearer, either.

What you could do, however, is abstract away the accept -> do something -> close thing into a macro:

(defmacro with-accepted-connection [listening-socket &amp; rest]
  (quasiquote (let [[*sock* (get (.accept (unquote listening-socket)) 0)]]
                (unquote-splice rest)
                (.close *sock*))))

(with-accepted-connection s (.send *sock* (upper (.recv *sock* 10000))))


The above may or may not work out of the box, I just conjured it up. But something similar may make the code lispier and easier to understand the intent later.