Hi Guix!

I wrote a Guile function that works like a script that take no arguments
and interacts with the filesystem, something like:

  (define (my-fn)
    ...)

It is a wrapper over other functions defined in the same file, and calls
them in the right order.

Then I wanted to make this function run as a mcron job, and I tried:

  (define my-fn-job
    #(job "* * * * *"
          my-fn))

But that doesn't work. At reconfigure time, Guix complains about not
knowing the variable 'my-fn':

  Unbound variable: my-fn

I tried wrapping it in a '(with-imported-modules ...)' call, but the
code isn't in a module, but in the same file.

I guess that putting all my code from 'my-fn' and all the functions it
calls inlined in a lambda in the job definition would solve it, but it
feels wrong to me.

Is there a way to reference it from the job, without embedding all the
scheme code in the job definition?

Reply via email to