Closed fasterthanlime closed 9 years ago
Also pay attention to def
, right now it just makes local variables. defn
does so too but should be rewritten as a macro, see #5.
Also compiler should parse "required" files that are shin/clojurescript as well & be able to output them all in a directory & recompile only the changed ones when in watch
mode.
Done most of the work on this, but this is harder than I thought.
:refer
shouldn't be much of a problem, but :use
(i.e. :refer :all
) is more delicate. The only reason it works in ki, afaict, is that everything is thrown into the global scope. Which is fine for one-off test code, but not for the neatly-encapsulated things we want here.
I see two options:
var something = _shin.namespaces['shin.core'].something
within the anon function all of a module's code resides in.The latter option does not particularly rejoice me: it'd mean hundreds of vars generated that it wouldn't necessarily use. Maybe uglifyjs would be able to reduce that, but who knows? Without doing some resolving on our side, we won't be able to eliminate most of those.
E.g.
ns
form with:require
,:use
should translate into Node/AMD requires/define properly.Also that would allow #4 and #5 which are very important.