Open ghost opened 8 years ago
For function arguments and local vars, the convention seems to be to use -fun
. Or simply call it fun
when clarification is not needed.
pred
and predicate
are also common
But if the clarification (which predicate) is needed, the convention is to end the variable name with -p
(or without the hyphen):
http://www.gnu.org/software/emacs/manual/html_node/elisp/Type-Predicates.html http://www.gnu.org/software/emacs/manual/html_node/elisp/Predicates-on-Numbers.html
Well, a function argument isn't necessarily a predicate.
👋
Dear emacs-lisp-style-guide,
I've always been afraid of naming things. Things began to go wrong when as a child I named my pet hamster C-x C-( # and all the kids in the school's vim user group made fun of me. A year later I named my pet chimpanze "grandma" and got no present for christmas! I had to steal some tinsel off the tree and take it to school pretending it was a new brand of "soft, linear slinky". It's just so difficult! The uncertainty and arbitrariness involved always make me feel like I've made the wrong choice and It has always been an endless source of mental anguish. That is why I am so glad to have a resource such as this, so that now when I make a bad choice I can simply point at someone else and claim "They made me do it!", just like that murder trial they put me through.
Ever since I began using your guide my life has been transformed. I now feel dynamic and vivacious, even vigorous. My wife tells me I've grown several inches, an unexpected delight at my ripe old age of 117! and I'm getting taller too!
One nagging issue I still have trouble with, which this admirable compandium of sound advice has provided no guidance on thus far, is the question of properly naming a function argument when writing a higher-order function. Should I use a suffix like
-func
or-f
? should I use a descriptive action name likescore-of
orcompare
? perhaps there is an even better way?Anxiously Awaiting your Advice,
Kind regards, Trepidatious in Trinidad