>
> In the Clojure case you extract the chunk with
>    tangle mydoc "Clojure code" >file
> and in the ClojureScript case you extract it with
>    tangle mydoc "ClojureScript code" >file
>
This adds an cumbersome step to the build process, adds an external 
dependency, and is exactly the kind of thing I want to avoid by using 
something like metadata to specify macro namespaces.  There are innumerable 
ways to slice up an input file so that bits of platform-specific code can 
be included in it, but that just seems so... anti-lisp.  To me it would be 
much preferable to have macros that allow for divergent platform 
implementations (e.g. (if-clj (then) (else)), etc).  I've actually started 
working on a library that provides such macros, but there's a problem: that 
very library has to be :required in a platform-specific way.  It's a bit of 
a chicken-and-egg problem that would just go away if the same ns form 
worked on both platforms.

To me, the basic problem here is that the ns macro differs between 
platforms, and there's simply no in-language way to work around it.  The 
other differences between platforms can be avoided in various ways (e.g. 
with my emezeske/prism <https://github.com/emezeske/prism> library), but 
since the ns macro's :require-macros option is handled magically by the 
compiler, there's just no in-language way to work around it.

Wouldn't it be nice to distribute some body of very pure algorithmic code 
that would "just work" on either Clojure or ClojureScript, even if it did 
need to use macros?

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