Re: Clojure Naming Conventions

2009-02-22 Thread Laurent PETIT
2009/2/22 Chouser chou...@gmail.com On Sat, Feb 21, 2009 at 5:36 PM, David Nolen dnolen.li...@gmail.com wrote: My point is simply that whether something is immutable or not has nothing to do with how that data structure is being used in the program. Naming conventions signify usage.

Clojure Naming Conventions

2009-02-21 Thread Howard Lewis Ship
I'm kind of used to Java nowadays, where CONSTANTS_ARE_UPPERCASE. I'm trying to figure out if Clojure has equivalent conventions. What I've seen: names-with-dashes instead of CamelCase *global* for global variables (?) Parameter name conventions (from Stu's book): val, coll, a, etc. What are

Re: Clojure Naming Conventions

2009-02-21 Thread Mark Volkmann
On Sat, Feb 21, 2009 at 2:47 PM, Howard Lewis Ship hls...@gmail.com wrote: I'm kind of used to Java nowadays, where CONSTANTS_ARE_UPPERCASE. I'm trying to figure out if Clojure has equivalent conventions. What I've seen: names-with-dashes instead of CamelCase Right. *global* for global

Re: Clojure Naming Conventions

2009-02-21 Thread Luc Prefontaine
In our software, we use uppercase or +name+ as constant names. Both Java and RUBY use uppercase, I think it's more a matter of taste what you decide to use. Ideally it should be obvious by looking at the name that some name is a constant name. Both of the above satisfy this criteria. Luc On

Re: Clojure Naming Conventions

2009-02-21 Thread David Nolen
+name+ is also in line with Common Lisp patterns http://www.cliki.net/Naming%20conventions On Sat, Feb 21, 2009 at 4:07 PM, Luc Prefontaine lprefonta...@softaddicts.ca wrote: In our software, we use uppercase or +name+ as constant names. Both Java and RUBY use uppercase, I think it's more a

Re: Clojure Naming Conventions

2009-02-21 Thread Phil Hagelberg
Mark Volkmann r.mark.volkm...@gmail.com writes: As best I can tell Clojure doesn't have a convention for constant names. Everything that's not expected to be rebound at runtime (*special-variables*) is by definition a constant (with the exception of refs, agents, and atoms). You don't need a

Re: Clojure Naming Conventions

2009-02-21 Thread David Nolen
The fact that the Clojure data structures are immutable and that some of those data structures might be used logically constants are two separate concerns. When reading Clojure code, we've already internalized the fact that the data structures are immutable. Using a naming convention for a

Re: Clojure Naming Conventions

2009-02-21 Thread Phil Hagelberg
David Nolen dnolen.li...@gmail.com writes: The fact that the Clojure data structures are immutable and that some of those data structures might be used logically constants are two separate concerns. I don't understand what this means. What's the difference between using a value that doesn't

Re: Clojure Naming Conventions

2009-02-21 Thread Chouser
On Sat, Feb 21, 2009 at 5:36 PM, David Nolen dnolen.li...@gmail.com wrote: My point is simply that whether something is immutable or not has nothing to do with how that data structure is being used in the program. Naming conventions signify usage. You could write a pure Java program and make

Re: Clojure Naming Conventions

2009-02-21 Thread David Nolen
Thanks for the points. What I was thinking, was that for things like π, in Clojure (as in CL), perhaps it makes to sense to mark it like so: +pi+ On Sat, Feb 21, 2009 at 8:59 PM, Chouser chou...@gmail.com wrote: On Sat, Feb 21, 2009 at 5:36 PM, David Nolen dnolen.li...@gmail.com wrote: My

Re: Clojure Naming Conventions

2009-02-21 Thread Luc Prefontaine
We chose to keep a naming convention for constants mainly because we are mixing Java, Ruby and Clojure in the same system. We have to replicate constants between the different languages. We needed a common anchor somehow to keep track of things and be able to track down changes. We typically use