I think the extend function is made exactly to support the concrete
implementation of protocols. It takes a type, and then any number of
protocol + function map pairs, where keyword names map to functions.
Checkout the protocol docs on assembla and look for extend:
On 09.02.2010, at 02:14, Stuart Sierra wrote:
On Feb 8, 6:13 pm, aria42 ari...@gmail.com wrote:
(defprotocol Span
(start [self])
(stop [self])
(span-length [self]))
Now I know I can just make span-length a function on Span as opposed
to part of the protocol. Is that what one should
If this situation is common enough, shouldn't defprotocol support
optional implementations which are implicitly merged?
On Feb 9, 6:01 am, Konrad Hinsen konrad.hin...@fastmail.net wrote:
On 09.02.2010, at 02:14, Stuart Sierra wrote:
On Feb 8, 6:13 pm, aria42 ari...@gmail.com wrote:
On 9 Feb 2010, at 22:29, aria42 wrote:
If this situation is common enough, shouldn't defprotocol support
optional implementations which are implicitly merged?
Yes, if it is common enough. It's perhaps too early to decide.
Konrad.
--
You received this message because you are subscribed to
Is it possible to have default implementations associated with
functions in a protocol? This is most useful when some protocol
functions are defined in terms of other. For instance,
(defprotocol Span
(start [self])
(stop [self])
(span-length [self]))
Now I know I can just make span-length
On Feb 8, 6:13 pm, aria42 ari...@gmail.com wrote:
(defprotocol Span
(start [self])
(stop [self])
(span-length [self]))
Now I know I can just make span-length a function on Span as opposed
to part of the protocol. Is that what one should do?
Yes.
-SS
--
You received this message
On Feb 8, 2010, at 6:13 PM, aria42 wrote:
Is it possible to have default implementations associated with
functions in a protocol? This is most useful when some protocol
functions are defined in terms of other. For instance,
(defprotocol Span
(start [self])
(stop [self])
(span-length
Hi,
On Feb 9, 12:13 am, aria42 ari...@gmail.com wrote:
Is it possible to have default implementations associated with
functions in a protocol? This is most useful when some protocol
functions are defined in terms of other. For instance,
(defprotocol Span
(start [self])
(stop [self])