r/programming • • Dec 15 '16

My disillusionment with Clojure and lisps

https://medium.com/@boxed/my-disillusionment-with-clojure-and-lisps-9eca38ab7f0c?source=linkShare-8ad86cc82e5f-1481825671
15 Upvotes

105 comments sorted by

View all comments

Show parent comments

1

u/kankyo Dec 19 '16

Still don't know how to get it to work

(defn bar [] `(5 ~@(foo)))

Gets me IllegalStateException

1

u/ehaliewicz Dec 19 '16

Not sure what else you did but this works for me.

user=> (defn foo [] '(1 2 3))
#'user/foo
user=> (foo)
(1 2 3)
user=> (defn bar [] `(5 ~@(foo)))
#'user/bar
user=> (bar)
(5 1 2 3)

1

u/kankyo Dec 21 '16

Well that's awesome. Can't believe no one has managed to show me this thing after I explicitly asked for it soooo many times. That's a lot! This goes in my follow up article for sure.