Re: Sharing a frustrating bug: using an atom to a hash as a hash

2011-04-21 Thread Armando Blancas
A type hint makes no difference because the param "state" is treated as an Object instance. user=> (:x @*aa*) 3 user=> (.invoke :x @*aa*) ; [16] invoke : Object (Object) 3 Besides, I don't think it's a good idea trying to setup some sort of static type-checker and strongly-typed functions. You're

Re: Sharing a frustrating bug: using an atom to a hash as a hash

2011-04-21 Thread Albert Cardona
2011/4/21 Tzach : > I made a stupid mistake, and I want to share. This is not the actual code, I > simplify it to demonstrate the point. > > I use a atom to a global hash as follow: > >  (def *aa* (atom {:x 3 :y 4 :z 17})) > > Somewhere on the code, I have a function which look at the state and do

Sharing a frustrating bug: using an atom to a hash as a hash

2011-04-20 Thread Tzach
I made a stupid mistake, and I want to share. This is not the actual code, I simplify it to demonstrate the point. I use a atom to a global hash as follow: (def *aa* (atom {:x 3 :y 4 :z 17})) Somewhere on the code, I have a function which look at the state and do something: (defn foo [stat