joker

Discuss all things joker, the Clojure interpreter/linter on top of Go. https://github.com/candid82/joker
oskarkv 2019-12-16T08:22:54.001Z

How do I require a library that I have written that is not in the same dir, like a utils library? Can I specify dependencies somehow?

jcburley 2019-12-16T09:26:33.001100Z

This should get you started, though there might (and, if not, should) be a document or section in the Joker distribution that gives a useful overview:

user=> (doc ns-sources)
-------------------------
joker.core/ns-sources
([sources])
  Adds to the built-in variable *ns-sources* which defines how to resolve
  external dependencies.
nil
user=> (doc joker.core/*ns-sources*)
-------------------------
joker.core/*ns-sources*
  A map from namespace reg-exps to the source to load the external dependency from
nil
user=> (doc joker.core/*classpath*)
-------------------------

  A vector of the classpath elements as configured by --classpath or
  the JOKER_CLASSPATH environment variable.

  Use colon-delimited <cp> (semicolon-delimited on Windows) for source
  directories when loading libraries via :require and the like (but
  not load-file). An empty field denotes the directory containing the
  current file being loaded, with zero or more trailing components
  removed as determined by the number of "." separators in the current
  namespace; or, if no file is being loaded, the current
  directory (this is original Joker behavior); a '.' (period) by
  itself denotes solely the current directory. Defaults to the value
  of the JOKER_CLASSPATH environment variable or, if that is
  undefined, the empty string (denoting a single empty field). The
  resulting classpath is stored herein, and this variable is used (in
  lieu of command-line arguments or environment variables) for all
  pertinent subsequent operations.
nil
user=> 

oskarkv 2019-12-16T09:31:01.001300Z

Thanks!

👍 1
jcburley 2019-12-16T13:26:21.002900Z

After seeing various questions here about libraries, decided to take on documenting some about this, borrowing heavily from here and elsewhere: https://github.com/candid82/joker/pull/301 Feel free to comment on the PR. Hope it's useful!

1
jcburley 2019-12-18T01:55:20.003200Z

This was merged a short while ago, so is now on master.