Re: Defrecord and Interfaces..

2011-07-30 Thread Andreas Liljeqvist
On a related note... If I have something like this: (defn make-archive [] (Archive. )) (defrecord Archive [] java.io.Closeable (close [_] (print "first try"))) user> (.close (make-archive)) first try (defrecord Archive [] java.io.Closeable (close [_] (print "second try"))) user> (

Re: Defrecord and Interfaces..

2011-07-30 Thread Andreas Liljeqvist
Thanks, that was very informative. I got no technical reason to expect that implementing an interface would define a function, lets just say that it felt right :/ 2011/7/29 Aaron Cohen > On Fri, Jul 29, 2011 at 3:18 PM, Andreas Liljeqvist wrote: > >> Is this a bug? >> >> > Nope, expectation dis

Re: Defrecord and Interfaces..

2011-07-29 Thread Aaron Cohen
On Fri, Jul 29, 2011 at 3:18 PM, Andreas Liljeqvist wrote: > Is this a bug? > > Nope, expectation dissonance. > (defprotocol Notcloseable (dosomething [this])) > > This is what actually defines the function "dosomething". Once this definition happens, the function exists and can be called. If yo

Defrecord and Interfaces..

2011-07-29 Thread Andreas Liljeqvist
Is this a bug? (defprotocol Notcloseable (dosomething [this])) (defrecord Archive [] java.io.Closeable (close [_] (print "closeable")) Notcloseable (dosomething [_] (print "something"))) user> (def a (Archive.)) user> (.close a) closeable user> (close a) Unable to resolve symbol