In file t.fnl
do:
(import-macros {: m} (.. ... :m))
And in file m.fnl
:
{:m #nil}
Then in REPL:
>> (local fennel (require :fennel))
>> (fennel.dofile "t.fnl" {} "t")
Compile error in t.fnl:1
[string "t.fnl"]:1: attempt to concatenate a nil value
(import-macros {: m} (.. ... :m))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This also happens with require-macros
special.
The extra args to
fennel.dofile
are passed in at runtime as...
for the module, but not at compile time.Right now at compile time,
...
is always bound to the module name and the filename. This matches the runtime behavior of modules that are loaded byfennel.searcher
, which is good, but it does not match the runtime behavior offennel.dofile
. We would have to do some kind of extra tracking to propagate these arguments specifically for modules that are not loaded by the searcher.