Re: clojure naming convention for accessors vs. local variables

2010-03-22 Thread Rich Hickey
On Mar 20, 2010, at 2:50 PM, cageface wrote: So will deftype/protocol be the recommended, idiomatic way to implement ADTs in Clojure 1.2? Yes. Will the current map/struct based approaches essentially be deprecated? These are two different things. deftypes will work fine with map-based

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread cageface
So will deftype/protocol be the recommended, idiomatic way to implement ADTs in Clojure 1.2? Will the current map/struct based approaches essentially be deprecated? The doc here http://www.assembla.com/wiki/show/clojure/Datatypes suggested to me that they were more for interfacing with Java in a m

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread Stuart Halloway
This will change in Clojure 1.2, with defstruct superseded by deftype, and with capitalization for defprotocols and deftypes. You might want to compare this Clojure example: http://github.com/relevance/labrepl/blob/master/src/solutions/rock_paper_scissors.clj to the OO solutions at http://w

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread David Nolen
On Sat, Mar 20, 2010 at 11:03 AM, strattonbrazil wrote: > Well, even in this case how do lisp programmers typically name their > structs vs their variables? In java I could make an "Employee" class > and then an "employee" object and it was easy to distinguish between > the two. If it's not kosh

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread strattonbrazil
Well, even in this case how do lisp programmers typically name their structs vs their variables? In java I could make an "Employee" class and then an "employee" object and it was easy to distinguish between the two. If it's not kosher to uppercase a struct, what's the convention for something lik

Re: clojure naming convention for accessors vs. local variables

2010-03-19 Thread ataggart
As the doc for 'accessor notes, you should really eschew this stuff altogether, and be more idiomatic by just using the keyword. If you absolutely know that you need that "(slightly) more efficient" access, then naming the struct with an uppercase first letter works, and isn't too uncommon; beside