Created
June 3, 2010 03:42
-
-
Save KirinDave/423416 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require '(blogpost [bloomfilters :as 'bloom]) | |
| ; We can do it this way: | |
| (extend-protocol BloomFilterable | |
| MyIntHolder | |
| (make-hash [this] (.data this)) ; return own data | |
| (human-readable-hash [this] (str (.data this)))) ; return a string | |
| ; Or perhaps like this: | |
| (extend-type MyIntHolder | |
| bloom/BloomFilterable | |
| (make-hash [this] (.data this)) | |
| (human-readable-hash [this] (str (.data this)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment