4 ms·
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
by ARandomerDude 6y ago
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.
- ballpark 6y agoIt 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.
- samatman 6y agoIs 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?
- ARandomerDude 6y agoYes, 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.
- casion 6y agoIf 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.