hyphens in function names

43 views
Skip to first unread message

Mark Volkmann

unread,
Nov 30, 2008, 7:22:48 AM11/30/08
to clo...@googlegroups.com
Is there a rule of thumb to apply when deciding whether to separate
multiple words in a function name with hyphens?
I can't detect a pattern in how this was decided for many provided functions.
Here are some examples that use hyphens: dotimes, gensyms, macroexpand
Here are some that don't: drop-last, find-doc, lazy-cat

--
R. Mark Volkmann
Object Computing, Inc.

Stuart Sierra

unread,
Nov 30, 2008, 2:20:33 PM11/30/08
to Clojure
On Nov 30, 7:22 am, "Mark Volkmann" <r.mark.volkm...@gmail.com> wrote:
> Is there a rule of thumb to apply when deciding whether to separate
> multiple words in a function name with hyphens?
> I can't detect a pattern in how this was decided for many provided functions.
> Here are some examples that use hyphens: dotimes, gensyms, macroexpand
> Here are some that don't: drop-last, find-doc, lazy-cat

Hi Mark,
There's no hard-and-fast rule, but a lot of it comes from Common Lisp,
like gensyms and macroexpand. There are a bunch of CL naming
conventions at <http://www.cliki.net/Naming%20conventions> but these
are not used entirely consistently in Clojure.

-Stuart Sierra

Mark Volkmann

unread,
Nov 30, 2008, 2:26:51 PM11/30/08
to clo...@googlegroups.com

Perhaps the rule of thumb should be to include hyphens in function
names to separate multiple words UNLESS omitting them makes the name
match one from another Lisp variant.

Reply all
Reply to author
Forward
0 new messages