+1 for meta-data...it fits the glove perfectly ;-)

On 12/04/12 18:52, Vinzent wrote:
First thing which comes to mind is to use metadata for this purpose. Something like

(defn ^{:platform :jvm} to-string [x] ...)

This doesn't force the user to create a separate file for each platform (although it's still possible to do so) and feels very naturally for clojure.

Another option is to use reader macros, like in Common Lisp:

#+ :jvm (defn to-string ...)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to