Very helpful, thanks!
Stu
On Mar 22, 10:54 am, Stuart Halloway
wrote:
The questions below refer to the gist athttps://gist.github.com/
336674/9ab832a86d203731c6379404d20afded79fe5f5b
and to protocols in general:
(1) Clojure automatically types hints the first argument when
extending a pr
On Mar 22, 10:54 am, Stuart Halloway
wrote:
> >> The questions below refer to the gist
> >> athttps://gist.github.com/336674/9ab832a86d203731c6379404d20afded79fe5f5b
> >> and to protocols in general:
>
> >> (1) Clojure automatically types hints the first argument when
> >> extending a protoc
Before someone dings me on the race condition, imagine I had factored
those repeated @cache calls into a (let [value# @cache] ...)
expression. The other thing I'm missing is a check for whether the
protocol has been changed since the cache entry was created; this
would be done by also maintaining a
>>> lookup (find-protocol-method) over the method invocation itself. Is that the
>>> right way to summarize the performance implications?
>>
>> No, since the result is cached. The real every-call overhead is having to
>> go through the var to detect changes to the protocol, vs the inline-defined
>>
On 22 Mar 2010, at 14:12, Per Vognsen wrote:
Even if the functions can be written in terms of the core protocol,
putting them in the protocol makes it possible to implement
higher-performance specialized versions for some containers while
supplying default implementations in terms of the core pr
The questions below refer to the gist at https://gist.github.com/336674/9ab832a86d203731c6379404d20afded79fe5f5b
and to protocols in general:
(1) Clojure automatically types hints the first argument when
extending a protocol to an interface or class, which is great. But
you cannot override
On Mon, Mar 22, 2010 at 7:20 PM, Rich Hickey wrote:
>
> On Mar 20, 2010, at 3:56 AM, Stuart Halloway wrote:
>
>> The questions below refer to the gist at
>> https://gist.github.com/336674/9ab832a86d203731c6379404d20afded79fe5f5b and
>> to protocols in general:
>>
>> (1) Clojure automatically types
On Mar 20, 2010, at 3:56 AM, Stuart Halloway wrote:
The questions below refer to the gist at https://gist.github.com/336674/9ab832a86d203731c6379404d20afded79fe5f5b
and to protocols in general:
(1) Clojure automatically types hints the first argument when
extending a protocol to an interfa
The questions below refer to the gist at https://gist.github.com/336674/9ab832a86d203731c6379404d20afded79fe5f5b
and to protocols in general:
(1) Clojure automatically types hints the first argument when
extending a protocol to an interface or class, which is great. But you
cannot override