ClojureScript

Cannot reference protocols using dot syntax (cljs.core.ILookup).

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

One used to be able to reference protocols using dot-separators; e.g.,

(satisifies? cljs.core.ILookup {:a 1}) ;;=> true

however, after CLJS commit 2aeb3d8f this is no longer possible.
These forms work correctly:

(satisfies? cljs.core/ILookup {:a 1})
(satisfies? ILookup {:a 1})

This issue came to my attention because core.match uses the cljs.core.ILookup form, so if that gets depreciated, downstream libraries will have to be updated.

Activity

Hide
Michał Marczyk added a comment -

Note that extend-protocol in Clojure expects the foo.bar/IQuux form (or IQuux in same namespace / after :use) and refuses to work with foo.bar.Quux. That's because in contrast to types and records, protocols actually expose a Var. The dotted name refers to the interface backing the protocol and seems to be an implementation detail.

So, I think the current behaviour is in line with how things are in Clojure.

Show
Michał Marczyk added a comment - Note that extend-protocol in Clojure expects the foo.bar/IQuux form (or IQuux in same namespace / after :use) and refuses to work with foo.bar.Quux. That's because in contrast to types and records, protocols actually expose a Var. The dotted name refers to the interface backing the protocol and seems to be an implementation detail. So, I think the current behaviour is in line with how things are in Clojure.
Hide
Kevin Lynagh added a comment -

Matching the syntax of JVM Clojure sounds reasonable to me.
I take it I should close this issue and open up a ticket/patch core.match to use the correct syntax?

Show
Kevin Lynagh added a comment - Matching the syntax of JVM Clojure sounds reasonable to me. I take it I should close this issue and open up a ticket/patch core.match to use the correct syntax?
Hide
Kevin Lynagh added a comment -

Patch opened on downstream lib:

http://dev.clojure.org/jira/browse/MATCH-62

Show
Kevin Lynagh added a comment - Patch opened on downstream lib: http://dev.clojure.org/jira/browse/MATCH-62

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: