Vinzent <[email protected]> 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.
That there's metadata already doesn't mean the reader would not need to
be adapted. And # is already a reader dispatch character, so there is
probably not much difference implementation wise.
> 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"}
But my own programs already use :platform and :version metadata with
completely different semantics. (Well, no, they don't, but it could
be.)
> Of course, it's possible to make #+{:version ...} work, but then I don't
> see how is it really differs from meta.
I'd still prefer a more general plain-macro version for conditional
compilation with arbitrary tests instead of hardcoded platform and
version keys. For example, I might want to be able to test if a certain
program is installed on the machine, or if a certain lib is in the
CLASSPATH.
Bye,
Tassilo
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en