Fork me on GitHub
#joker
<
2019-11-09
>
hlship00:11:42

So I'm trying to create a joker.markup namespace for generating XML/HTML markup using Hiccup syntax. My new markup.joke includes a require of joker.html and that's failing:

16:17:09 ~/workspaces/golang/src/github.com/candid82/joker > ./run.sh --version && go install
<joker.markup>:5:5: Exception: No namespace: joker.html
Stacktrace:
  global <joker.markup>:1:1
  core/require <joker.core>:3483:3
  core/apply <joker.core>:527:4
  core/apply__ <joker.core>:3400:9
  core/apply <joker.core>:527:4
  core/apply__ <joker.core>:3353:5
  core/with-bindings* <joker.core>:1406:7
  core/apply <joker.core>:525:4
  core/apply__ <joker.core>:3380:9
  core/apply <joker.core>:527:4
  core/apply__ <joker.core>:2400:40
  core/ex-info <joker.core>:190:35
panic: <file>:0:0: Eval error: <joker.markup>:5:5: Exception: No namespace: joker.html
Stacktrace:
  global <joker.markup>:1:1
  core/require <joker.core>:3483:3
  core/apply <joker.core>:527:4
  core/apply__ <joker.core>:3400:9
  core/apply <joker.core>:527:4
  core/apply__ <joker.core>:3353:5
  core/with-bindings* <joker.core>:1406:7
  core/apply <joker.core>:525:4
  core/apply__ <joker.core>:3380:9
  core/apply <joker.core>:527:4
  core/apply__ <joker.core>:2400:40
  core/ex-info <joker.core>:190:35

goroutine 1 [running]:
, 0xc00091b040)
        /Users/hlship/workspaces/golang/src/github.com/candid82/joker/core/eval.go:440 +0x6a
main.main()
        /Users/hlship/workspaces/golang/src/github.com/candid82/joker/core/gen_data/gen_data.go:96 +0x61d
exit status 2
core/object.go:1: running "go": exit status 1
Is there a way around this? My guess is that since std/html.joke is a built-in namespace there's an issue with having a dependency to it during generate stage?

Candid18:11:56

html package is not imported in gen_data. You'd have to add _ "" here https://github.com/candid82/joker/blob/master/core/gen_data/gen_data.go#L10 to make it work

hlship18:11:59

Darn it! I just figured this out 30 seconds ago!

hlship00:11:11

That was helpful, though I blundered through most of it over the weekend.

😀 4