El 8/12/23 a las 14:26, Luis Felipe escribió:
Hi Nikolaos,
El 8/12/23 a las 6:59, Nikolaos Chatzikonstantinou escribió:
Hello guile-user list,

I am trying to figure out modules and unit tests on Guile.

I would like to have a main.scm that prints a variable defined in
lib.scm and has unit tests in test.scm.

What I thought I had to do was to use

     (add-to-load-path (dirname (current-filename)))

This seemed to be the suggestion in 6.16.8 Load Paths of the Guile
manual. My entire main.scm looks like this:

     (define-module (applejack main))
     (add-to-load-path (dirname (current-filename)))
     (use-modules (applejack lib))
     (define-public (main)
       (format #t "Hello from ~a!~%" name))

My lib.scm is:

     (define-module (applejack))
     (define-public name "Applejack")

but I get an error, which I believe originates from current-filename
returning #f. Separately, the test suite in test.scm is just the
example in SRFI-64, but I don't know how to run it. I am using Emacs
and geiser-mode. If I run geiser-eval-buffer, I get test output, and
it promises that there is some more in vec-test.log, but the logfile
stands empty.

I would appreciate it if some pointers for the workflow of a small
Guile project along the lines above were given.
Personally, I'm using these

For running tests: https://luis-felipe.gitlab.io/guile-proba/
For documentation extraction: https://luis-felipe.gitlab.io/guile-documenta/

(I sent the message incomplete by accident)

Attachment: OpenPGP_0x0AB0D067012F08C3.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to