>
> ^{:platform :jvm} (load "jvm/lib") 

^{:platform :python} (load "python/lib")


or platform metadata attached to the 'ns' form should be trated as "this 
whole file is for this platform". This way, in src/py/blah.clj you'd have

^{:platform :python}
(ns blah)
...
(your code)
...

without relying on file extensions, directory structure or similar things.


Tassilo Horn writes:

> But why would that be better than a reader macro
>   #+:jvm    (load "jvm/lib")
>   #+:python (load "python/lib")


I don't think it's "better", this two options are rather equivalent. The 
only difference is that #+ would require new reader entities, while variant 
with metadata leverages already existing clojure facilities.

Although, another thing is that it looks like metadata would be more 
flexible; for example, one could write

^{:platform :jvm, :version "1.7"}

or maybe even something like 

^{:platform :jvm, :version "[1.7,)", :implementation "sun"}

Of course, it's possible to make #+{:version ...} work, but then I don't 
see how is it really differs from meta.

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