Fork me on GitHub
#joker
<
2019-10-18
>
borkdude07:10:21

@hlship actually I have been considering EDN (Hiccup) -> HTML conversion for jet (https://github.com/borkdude/jet), I think it's a natural fit

borkdude08:10:50

In this branch: https://github.com/borkdude/jet/tree/hiccup I've now got:

$ ./jet --from html <<< '<p><span>hello</span></p>'
[:p {} [:span {} "hello"]]

$ ./jet --to html <<< '[:p [:span "hello"]]'
<p><span>hello</span></p>
Not sure if that's useful or if I should make a distinction between hiccup and hickory 🙂

jcburley19:10:43

FWIW, today I upgraded my two main development machines (amd64-linux and amd64-darwin) to Go 1.13 (.3 and .1, respectively), and have had no issues so far -- Joker tests all pass, both for master and for my gostd fork. Also, I added Joker and Go version info to the top-level index pages for each architecture (Windows TBD, as I use that machine only weekly usually) for the gostd fork's documentation: https://burleyarch.com/joker/docs/

borkdude20:10:33

what's gostd?

jcburley21:10:09

It's my own fork, which adds a component that autowraps much of the Go std for (kludgy) access via Joker code.

hlship23:10:51

Mostly I've been writing one-off scripts in Joker; but there's a couple of things I'd like to put in a library (i.e., I have two scripts that live in the same folder, it would be nice if I could factor out some code into a common file also in that folder). Not stuff that should be packaged with Joker itself. Without going to the code (I don't really read Go) where does require search for libraries? Is there a way to modify that?

👍 4
jcburley23:10:54

There's also this little hidden/undocumented "gem", from awhile back, that might still work -- though I haven't looked at how this all interacts since the above stuff was implemented:

user=> (joker.repl/print-doc (meta (var 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=>

hlship00:10:26

What would work best for me would be, when loading via /usr/bin/env, it would look at the script, follow it if it's a link, and add that directory to the classpath.

hlship00:10:44

But that's a bit specific to add.

jcburley00:10:26

There's probably plenty of room for improvement, in Joker docs if not also code/features, in this area. We'll likely get more input re requirements as more people us it more widely and beyond linting.

jcburley00:10:17

Maybe supporting a hook or something in the require/load mechanism would help?