Re: almost abusing the system... defmutabletype

2011-03-18 Thread Sunil S Nandihalli
Hi Gomez, Thanks for your response. The goal was to implement the half_edge datastructure .. it is described here . I felt using atoms was not going to serve any extra purpose .. What would you be doing in this situation... So go

Re: almost abusing the system... defmutabletype

2011-03-18 Thread Daniel Solano Gomez
On Fri Mar 18 18:33 2011, Sunil S Nandihalli wrote: > I wanted to define a bunch of types which were mutable to be used in > defining a cyclic data structure. So, I wrote the following macro... > > … code sample … > > although not idiomatic clojure .. thought some of you may find it useful. > Sun

Re: almost abusing the system... defmutabletype

2011-03-18 Thread Sunil S Nandihalli
https://gist.github.com/876029 On Fri, Mar 18, 2011 at 6:33 PM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Hello everybody, > I wanted to define a bunch of types which were mutable to be used in > defining a cyclic data structure. So, I wrote the following macro .. . > > (defmacro

almost abusing the system... defmutabletype

2011-03-18 Thread Sunil S Nandihalli
Hello everybody, I wanted to define a bunch of types which were mutable to be used in defining a cyclic data structure. So, I wrote the following macro .. . (defmacro defmutabletype [type-name members] (let [proto-name (symbol (str "I" (name type-name))) member-setter-names (map #(symbo