Joel Kaasinen
Technology
A Christmas Present in Clojure

For Christmas 2025, I want to give you peace. The peace of not counting parens, just letting the words stream out from your keyboard, unfettered by requirements of structure, symmetry, unbothered by the tyranny of hierarchy.
Merry Christmas!
Here's pinoa, a way to write clojure without parentheses, in the spirit of Reverse Polish Lisp.
(require 'pinoa)
(pinoa/pinoa 1 2 + 3 *)
; => 9
(macroexpand-1 '(pinoa/pinoa 1 2 + 3 *))
; => (* (+ 1 2) 3)
The transformation is purely syntactic, so you can use control structures like if or even build anonymous functions!
(pinoa/pinoa [x] x 3 + fn 4 nil cons map)
; => (7)
(macroexpand-1 '(pinoa/pinoa [x] x 3 + fn 4 nil cons map))
; => (map (fn [x] (+ x 3)) (cons 4 nil))
Pinoa tries to deduce the correct arity of functions, but you can pick an explicit arity by adding a number:
(macroexpand-1 '(pinoa/pinoa :foo :bar str2 :quux str1 vector2))
; => (vector (str :foo :bar) (str :quux))
(pinoa/pinoa :foo :bar str2 :quux str1 vector2)
; => [":foo:bar" ":quux"]
(macroexpand-1 '(pinoa/pinoa :foo :bar str1 :quux str1 vector3))
; => (vector :foo (str :bar) (str :quux))
(pinoa/pinoa :foo :bar str1 :quux str1 vector3)
; => [:foo ":bar" ":quux"]
Finally,
(pinoa/pinoa [s [k v]] s "{" k name "}" str3 v str1
clojure.string/replace3 fn
"Have a {feeling} Christmas, {name}!"
{} :feeling "rejuvenating" assoc :name "my friend" assoc
reduce3)
; => "Have a rejuvenating Christmas, my friend!"
PS. previously...
Joel Kaasinen


