On Dec 29, 3:40 pm, "Mark Volkmann" <[email protected]> wrote:
> On Mon, Dec 29, 2008 at 2:24 PM, Brian Doyle <[email protected]> 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.

-Stuart Sierra
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to