odd failure on recursive use of protocol member

2013-12-10 Thread Michael Blume
I have a protocol RestSerializable to represent data that can be serialized to json from a REST interface. (defprotocol RestSerializable (rest-serialize [this] Convert to something Cheshire can JSONify)) By default, things are left alone (extend Object RestSerializable

Re: odd failure on recursive use of protocol member

2013-12-10 Thread Kevin Downey
extend mutates some state (the protocol definition), so what is happen here is comp is returning a new function built from the value of the rest-serialize var (the protocol function before the extend changes it) and the value of the deref var. I have not verified this, but I suspect if you use

Re: odd failure on recursive use of protocol member

2013-12-10 Thread Michael Blume
Oh, interesting. I knew it was changing *some* state but I didn't realize it was actually changing the binding of the rest-serialize var. Thanks =) On Tue, Dec 10, 2013 at 4:09 PM, Kevin Downey redc...@gmail.com wrote: extend mutates some state (the protocol definition), so what is happen