Re: Protocols not changing the caller's contract

2010-08-13 Thread Kevin Downey
IPersistentMap is an interface, which are sort of the java analog of protocols, and in fact last I checked protocols generate named java interfaces, so I think you're fine On Fri, Aug 13, 2010 at 5:10 PM, Brenton wrote: > Greetings, > > Suppose that I create a function that is designed to receive

Protocols not changing the caller's contract

2010-08-13 Thread Brenton
Greetings, Suppose that I create a function that is designed to receive a map as a parameter: (defn add-ten [m] (+ 10 (:amount m))) but then later I want to make this function part of a protocol (defprotocol AddTen (add-ten [this])) but I still want it to work when someone passes a plain m