News for hackers. Stuff that matters.
Re:Clojure from a Schemer's Perspective by ARandomerDude on Friday March 05, 2021 @11:06AM (#26358344)
Huge Clojure fan here, been using it professionally for 9 years.

This is a good article, highlighting a couple of the warts, which I think is a missing element for most people who like a language.

I completely agree with the nil punning observation. One of the issues pointed out in the article that resonated most with me is functions in the standard library usually (but not always) nil pun. You get used to nil, so when the standard library does throw a runtime exception, you're surprised. For example:

(:foo nil) => nil

(int nil) => exception

Overall great article.

Re:Clojure from a Schemer's Perspective by ballpark on Friday March 05, 2021 @12:32PM (#26359456)
It can be indicative of the goodness of a language when you use it for 9 years and are still a huge fan. I'm in the same boat.
Re:Clojure from a Schemer's Perspective by samatman on Friday March 05, 2021 @03:31PM (#26361678)
Is this a case of Java leaking through again?

As in, Clojure uses int rather than Integer, so it simply can't be nil aka null?

Re:Clojure from a Schemer's Perspective by ARandomerDude on Friday March 05, 2021 @04:47PM (#26362551)
Yes, I think so. Given how other functions work though, I would expect nil in this case, since Clojure is a language, and not just a Java library.
Re:Clojure from a Schemer's Perspective by casion on Friday March 05, 2021 @04:47PM (#26362558)
If you want to nil pun like that, it's not difficult to do it where necessary.

(some-> nil :foo)

(some-> nil int)

Of course this fails if your nil is actually a string, but that's a different issue.