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

Like the *-prefix, I derived significant readability by prefixing all reference type symbols (like atoms) with !, which goes hand-in-hand with the exclamation mark in `swap!` and `reset!`. For example:

    (let [!input (atom {:some "data"}]
      (emit! ::event @!input) ;; @ and ! always go together
      (reset! !input {:new "data"})) ;; mutations against plain symbols "looks wrong"


I like that. I think it reads a bit better because ! looks less like @. The analogue with reset! and swap! is nice too.

However, right now I'm also working with Java (unfortunately :D) and !input looks a bit too similar to a not condition, so adds a tiny bit to my language context switch.




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

Search: