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 the
If this situation is common enough, shouldn't defprotocol support
optional implementations which are implicitly merged?
On Feb 9, 6:01 am, Konrad Hinsen wrote:
> On 09.02.2010, at 02:14, Stuart Sierra wrote:
>
> > On Feb 8, 6:13 pm, aria42 wrote:
> >> (defprotocol Span
> >> (start [self])
> >>
On 09.02.2010, at 02:14, Stuart Sierra wrote:
> On Feb 8, 6:13 pm, aria42 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 d
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:
http://www.assembla.com/wiki/sh
Hi,
On Feb 9, 12:13 am, 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-
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-l
On Feb 8, 6:13 pm, aria42 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 because you