On Mon, Dec 29, 2008 at 3:01 PM, Stuart Sierra <the.stuart.sie...@gmail.com> wrote: > > On Dec 29, 3:40 pm, "Mark Volkmann" <r.mark.volkm...@gmail.com> wrote: >> On Mon, Dec 29, 2008 at 2:24 PM, Brian Doyle <brianpdo...@gmail.com> wrote: >> > Looking at this code the uppercase variables stands out. >> > This isn't idiomatic is it? >> >> > (def GRID_SIZE 10) >> > (def HEIGHT 600) >> > (def MARGIN 50) >> >> I don't know. I was following Java conventions of making constants all >> uppercase. Is there a convention for this in Clojure? > > Hi Mark, > > There's a Common Lisp convention of surrounding constant names with > "+", like: > (def +grid-size+ 10) > but even in CL it's not followed consistently. Go with what feels > good. :) > >> Is there a way I could prevent them from being changed later? > > Not really, you can always re-def.
Thanks for the info. Stuart! It's early enough in the life of Clojure that we haven't developed any deeply held habits yet. I think it would be a good idea for you and other Clojure committers to at least suggest the way you think things should be done in code. If you think surrounding names of constants with plus signs is a good way to identify them as such, I'll gladly start doing that for the sake of consistency. I don't think it's a good idea for all of us to simply do what feels good because that will make it harder to read code written by others. -- R. Mark Volkmann Object Computing, Inc. --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---