Skip to content

Commit

Permalink
Merge pull request #1 from slipset/patch-1
Browse files Browse the repository at this point in the history
Fix some spelling erors
  • Loading branch information
iku000888 authored Aug 2, 2017
2 parents d5e3fe1 + 3217cb3 commit d647ac7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/guides/clj_datatype_constructs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ifdef::env-github,env-browser[:outfilesuffix: .adoc]

== Goals of this guide

Clojue supports several constructs for speaking to the Java world
Clojure supports several constructs for speaking to the Java world
and creating types for polymorphic dispatch. +
Because these constructs have overlapping capabilities, it may be confusing to know which construct to use at a given situation. +
Hopefully this guide clarifies what each construct is good at, while presenting minimal usage examples.
Expand Down Expand Up @@ -142,12 +142,12 @@ user=> (.close rf)
nil
----

One might ask "Doesn't proxy achieves the same if you do not need to extend a concrete Type?" +
One might ask "Doesn't proxy achieve the same if you do not need to extend a concrete Type?" +
The answer is reify has better performance.

== Take away
To wrap up, here are some rules of thumb:

* Prefer protocols and records over Java Types; stay in Clojure
* If you must extend a Java Class, use proxy
* If you want a on-off implementation of a Protocol/Interface, use reify
* If you want a on-off implementation of a Protocol/Interface, use reify

0 comments on commit d647ac7

Please sign in to comment.