But I don't exactly understand the "impure" functions. Are they
Obviously, official clojure apis don't have bang!s on every case above. I wonder when should I put them and need your help to make my code saner.
In programming and scripting languages, the exclamation mark is used as "not." For example, "! =" also means not equal. See our operator definition for further information. Used to help identify a nonexecutable statement.
In general, using an exclamation mark before the command will pass the command to the shell (not to the Python interpreter). Note that this differs from executing a python program in IDLE: IDLE restarts the Python interpreter session and thus deletes all existing objects before the execution starts.
In java,exclamation mark ( ! ) that is used for inverted the value and also we call Boolean negation operator ( != being not equal to). example:if(string variable!= null) here check whether string variable is null or not.
I would say you don't need to put !
on every impure function. Community Clojure Style Guide recommends:
The names of functions/macros that are not safe in STM transactions should end with an exclamation mark.
So, basically, end with !
functions that change state for atoms, metadata, vars, transients, agents and io as well.
Thanks to @noisesmith for update.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With