As i see, clojure has more characters for variable name than c/c++/java. For example:
Functions end with '?' usually return a Boolean, they are predicate.
There are also variables starting with '-', or ending with '!'.
i think these are all clojure-style naming. So, what's the usual naming rule in clojure? is there something in common for clojure programmers?
It's worth looking at Clojure's Library Coding Standards which I think are still probably the best reference on Clojure coding style.
The main function naming conventions seem to be:
frobnicate
frobnicate-with-extra-fizz
my.special.collection/concat
?
to indicate a predicate that returns true or false: sequential?
!
to indicate a function with side effects that is not transaction safe, e.g.: set!
For local variables the following are common:
f
, g
, h
- functionsn
- integer representing a size or countindex
, i
- integer indexx
, y
- numberss
- string inputcoll
- a collectionpred
- a predicate closure& more
- variadic inputClojure is a dialect of Lisp, so Lisp convention may apply: http://www.cliki.net/naming%20conventions
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