I'm not sure how exactly this should work but the current behavior is probably inaccurate:
Welcome to Fennel 1.0.0-dev on Lua 5.4! Use ,help to see available commands. Try installing readline via luarocks for a better repl experience. >> (tset _G :foo (fn  (print :foo))) nil >> (foo) foo >> (tset _G :foo-bar (fn  (print :foo-bar))) nil >> (foo-bar) runtime error: global '__fnl_global__foo_2dbar' is not callable (a nil value) stack traceback: ...
There's definitely a bug here, but the bug is that the first one works, not that the second one doesn't.
Using the _G table is more or less a way to bypass the strict globals checking, since it's just table access. If you want to set a global in a way that participates in strict globals checking, you use the
(global foo-bar (fn  (print :foo-bar))) (foo-bar) foo-bar
This works fine. However, the first one should not work at all; it looks like somehow strict globals checking stopped working in the repl.
However, the first one should not work at all; it looks like somehow strict globals checking stopped working in the repl.
I agree. This was fixed in a11d3658