Hacker News new | past | comments | ask | show | jobs | submit login

Huh? Changing a var? That is very unidiomatic in Clojure and very strongly discouraged. You generally would (def ...) a var once and then it never changes. If you need mutable state, you use an atom, ref or similar, but redefining vars is quite rare in my experience.

This is why "reify" and "proxy" exist and are used quite frequently.

Not that frequently. I've only ever used reify for working with Om (and not touched since I switched to reagent). I think the last time I used proxy was 5 years ago. Of course, if you're directly interfacing with Java, you may need to use both, but for my own needs, almost all the Java I wanted to interface with already had Clojure wrappers (which I guess internally used reify/proxy and friends, but I did not have to know about this)




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: