>> First thing which comes to mind is to use metadata for this purpose.
>> Something like
>>
>> (defn ^{:platform :jvm} to-string [x] ...)
>


What we need is even more defined then that, however, Consider this
snippet from core.match:

(ns clojure.core.match
  (:refer-clojure :exclude [compile])
  (:require [clojure.set :as set])
  (:import [java.io Writer]))

how do we use metadata to restrict/include java.io.Writer vs CLR's
System.IO.TextWriter? If we go with the meta-data route, then we're
forced to put ^{:platform :jvm} 40 times in a single file instead of
just putting the code in a different file and not needing to clutter
the code with extra meta-data. Not to mention that defmacro, deftype,
defprotocol, etc. would all need to check for this metadata before
executing.


cljx is a lein plugin...I'm trying to figure out how to do this on the
compiler level. It seems that it would be good to have a way to to
this in clojure-clr, clojure-scheme, etc.

Timothy

-- 
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