refs implement IFn, atoms and agents do not?

2009-10-03 Thread Stuart Halloway
Is there a principled reason for this? I have written some code that (unintentionally) limits itself to refs because it assumes that all reference types can sit in function position. Thanks, Stu --~--~-~--~~~---~--~~ You received this message because you are s

Re: refs implement IFn, atoms and agents do not?

2009-10-04 Thread Stephen C. Gilardi
On Oct 3, 2009, at 1:50 PM, Stuart Halloway wrote: Is there a principled reason for this? I have written some code that (unintentionally) limits itself to refs because it assumes that all reference types can sit in function position. This discussion: http://groups.google.com/group/clojure/br

Re: refs implement IFn, atoms and agents do not?

2009-10-04 Thread Mark Volkmann
On Sun, Oct 4, 2009 at 3:07 PM, Stephen C. Gilardi wrote: > > On Oct 3, 2009, at 1:50 PM, Stuart Halloway wrote: > >> Is there a principled reason for this? I have written some code that >> (unintentionally) limits itself to refs because it assumes that all >> reference types can sit in function

Re: refs implement IFn, atoms and agents do not?

2009-10-04 Thread Stephen C. Gilardi
On Oct 4, 2009, at 5:04 PM, Mark Volkmann wrote: Minor technicality ... Vars are a reference type, but deref and @ don't work with them. I'm guessing you're thinking of an interaction like this: user=> (def a 3) #'user/a user=> @a java.lang.ClassCastException: java.

Re: refs implement IFn, atoms and agents do not?

2009-10-04 Thread Mark Volkmann
On Sun, Oct 4, 2009 at 4:26 PM, Stephen C. Gilardi wrote: > > On Oct 4, 2009, at 5:04 PM, Mark Volkmann wrote: > >> Minor technicality ... Vars are a reference type, but deref and @ don't >> work with them. > > I'm guessing you're thinking of an interaction like this: > >        user=> (def a 3)