Skip to content

Instantly share code, notes, and snippets.

@alandipert
Created January 21, 2015 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alandipert/47f0badda7bcdb28af87 to your computer and use it in GitHub Desktop.
Save alandipert/47f0badda7bcdb28af87 to your computer and use it in GitHub Desktop.
(deftype MyCountable [delegate]
#ifdef clj
clojure.lang.Counted
#endif
#ifdef cljs
ICounted
#endif
#ifdef clj
(count [_] (.count delegate))
#endif
#ifdef cljs
(-count [_] (-count delegate))
#endif
)
;gcc -E -x c -P -C -Dcljs count.clj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment