Skip to content

Commit 8b4bb25

Browse files
authored
Merge pull request #176 from harrigan/patch-1
Reorder the comment about parents and ancestors
2 parents dba579c + fda7627 commit 8b4bb25

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

content/reference/multimethods.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,6 @@ https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/isa%3F[isa?
8787
-> true
8888
----
8989

90-
https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/isa%3F[isa?] works with vectors by calling https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/isa%3F[isa?] on their corresponding elements:
91-
92-
[source,clojure]
93-
----
94-
(isa? [::square ::rect] [::shape ::shape])
95-
-> true
96-
----
97-
9890
as do https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/parents[parents] / https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/ancestors[ancestors] (but not https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/descendants[descendants], since class descendants are an open set)
9991

10092
[source,clojure]
@@ -106,6 +98,14 @@ as do https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/paren
10698
java.util.RandomAccess java.util.AbstractList}
10799
----
108100

101+
https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/isa%3F[isa?] works with vectors by calling https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/isa%3F[isa?] on their corresponding elements:
102+
103+
[source,clojure]
104+
----
105+
(isa? [::square ::rect] [::shape ::shape])
106+
-> true
107+
----
108+
109109
== isa? based dispatch
110110

111111
Multimethods use https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/isa%3F[isa?] rather than = when testing for dispatch value matches. Note that the first test of https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/isa%3F[isa?] is =, so exact matches work.

0 commit comments

Comments
 (0)