Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know anyone who writes code like that. Unnecessary wrapping of functions is an antipattern.

Idomatic Clojure for what you just wrote is:

(println "Hiya.")

(println "How's it ")

(println "going?")

If a Clojureist wanted to get fancy and build an abstraction (as they probably would) they'd probably write a debug function instead of using 'println' directly:

(log/debug "Hiya.")

(log/debug "How's it ")

Which is, granted, an abstraction, but isn't any harder to read.



Or define a function called `printlns`. Then call...

    (printlns "Hiya." "How's it " "going?")


Actually the default `println` already does that. ;)


`println` inserts a space between its arguments. I was showing we could define one that inserts a newline instead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: