On Feb 25, 12:17 am, joshua-choi <rbysam...@gmail.com> wrote:
> When it comes to distinguishing certain types of symbols from other
> things, should one use prefixes or suffixes?

Whichever makes more sense, of course. :)

>
> Example: naming tests with clojure.test/deftest. If you distinguish
> your tests’ symbols at all, do you do “t-addition” or “addition-t”?
>

Name tests descriptively. Putting them in their own namespace helps
too. If there's absolutely a need to distinguish them from non-tests,
I would prefer '-test'. Abbreviating it just makes it noisy.

> (I need to know what the standard is, if there is any, because I need
> a way to distinguish a certain type of symbol—those that represent
> “rules”— in my libraries. I’m using an underscore suffix right now,
> like “vector_”, which means “vector-rule” But “_rule” might be better,
> or even “_rule_”, though the last one might be overkill. In the past,
> I’ve used “vector-r", but I don’t like that now.)

I personally find underscores offensive, but... Some logic DSLs use ?
foo for variables, maybe you could have something similar for you
rules. Or you could name them using angled brackets (eg. <vector>).
When it comes to naming, you just need to be consistent. And avoid
underscores, please :P

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to