Protocol functions fail to find future extensions when assigned to a local or new var

Description

Environment

None

Activity

Show:
import
August 8, 2015, 6:47 PM

Comment made by: nathanmarz

This issue appears to be Clojure specific – I did some testing in CLJS and was unable to reproduce the issue.

Ghadi Shayban
August 9, 2015, 3:51 PM

Nathan,
Not sure if you tried this, but using:

rather than dereffing outright.

import
August 10, 2015, 12:25 AM

Comment made by: nathanmarz

That's a good workaround but it does seem that my test case should work. I ran into this because I was passing around functions dynamically and saving them for later execution – and this issue popped up with protocol methods. Having to pass around protocol methods differently than regular functions doesn't seem right.

Kevin Downey
August 10, 2015, 5:21 PM

this is a result of the protocol implementation in clojure, protocol extension mutates the vars, once you have taken then value of the var (which happens once for top level forms) you will not see further mutations of the var so no more protocol extension

Assignee

Unassigned

Reporter

import

Labels

Approval

Triaged

Patch

None

Affects versions

Priority

Minor