On Tue, Jan 6, 2009 at 11:54 AM, Stuart Halloway
<stuart.hallo...@gmail.com> wrote:
>
>> Code like @*foo* is not something I've seen in any code Rich has
>> written, so I think Stuart is right in considering removing the
>> asterisks on *apple* and *snake*
>
> I plan to remove them. What I still wrestle with is using "snake" at
> the top level as ref, and then having a bunch of pure functions that
> shadow the top level snake with a binding to an immutable snake data
> structure.
>
> I think a naming convention for refs would be more valuable than a
> naming convention for constants.

Refs are much more likely than Vars to be stored inside collections
(and thus have no name of their own) or to be locals.

The difference between the word 'snake' when used as an arg vs. when
used at the top level is that the former means essentially "any
snake", while the latter is specifically the one global snake support
by the app.  So perhaps the global could be called 'the-snake' or
'main-snake'.

Another option would be to get rid of all global state.  Perhaps like this:

http://github.com/Chouser/programming-clojure/tree/master/examples/snake.clj

That was more work than I was expecting, and I see Rich recommended
this approach while I was working on the code.  Ah well.

There appears to be a problem with 'lose?', but I don't think I caused it.

--Chouser

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to