Am 18.10.25 um 11:46 schrieb Richard Shann:
On Fri, 2025-10-17 at 18:52 +0200, Andreas Schneider wrote:
Am 17.10.25 um 10:37 schrieb Richard Shann:
On Thu, 2025-10-16 at 19:19 +0200, Andreas Schneider wrote:
Am 15.10.25 um 10:14 schrieb Richard Shann:
   > On Tue, 2025-10-14 at 22:09 +0200, Andreas Schneider wrote:
   >> Am 14.10.25 um 21:37 schrieb Richard Shann:
   >>> On Tue, 2025-10-14 at 19:43 +0200, Andreas Schneider wrote:
   >>>> Am 14.10.25 um 10:49 schrieb Richard Shann:
   >>>>> On Mon, 2025-10-13 at 19:12 +0200, Andreas Schneider
wrote:
   >>>>>
   >>>> [...]
   >>>> Unfortunately, I get a script error:
   >>>
   >>> You have omitted the first line of the script
   >>>
   >>> (use-modules (ice-9 string-fun))
   >>>
   >>> that module provides the function needed.
   >>
   >> I do have included this line,
   >
   > Oh, sorry, I missed it because it came at the end of the the
line
"A
   > script error for file/script" and I started reading the
script
from
   > there.
   >
   >> see attached screenshot. Maybe, it does
   >> not find the module. Although I have the packages guile-3.0-
libs
and
   >> guile-2.2-libs (that both include ice-9/string-fun.scm)
installed.
   >
   > hmm, I didn't do anything special to get it included. If you
get
up
   > guile in a terminal and try to include the module does it
work?

I have tested with a simple test program

(use-modules (ice-9 string-fun))
(string-replace-substring "text" "t" "")

In a guile terminal, it works flawlessly, however, in the Denemo
scheme
script window it throws a script error.

I the Denemo scheme CLI box if you execute this procedure:

(%library-dir)

what do you get on the terminal? I get

=> /usr/share/guile/3.0

With (disp (%library-dir)) I get /usr/share/guile/2.2 The script
/usr/share/guile/2.2/ice-9/string-fun.scm does exist.

It looks like I compile with guile 2.2. This is the same version the
system lilypond depends on.
Reading the Denemo souce code (at src/core/main.c) there seems (for
non-windows build) to be only an append of the denemo-modules directory
to the GUILE_LOAD_PATH.
So it seems strange that if I execute

export GUILE_LOAD_PATH=/usr/share/guile/2.2
and start Denemo and then display (%library-dir) I still get guile/3.0
on exiting Denemo I see

  echo $GUILE_LOAD_PATH
/usr/share/guile/2.2

as on entry.

  Would you recommend to rather compile with
guild 3? I have both 2.2 and 3.0 installed.

I too have both guile2 and 3 installed, and but I just build from
source with the near-default

./denemo/configure CFLAGS="-g -O0"

and a --prefix option to install locally.

I also have the version of Denemo installed from Debian for my
(Bookworm) version of Debian. It uses guile 2.2 and exhibits the bug
you are seeing - the following script illustrates this:

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
(use-modules (ice-9 string-fun))
(d-WarningDialog (regexp-quote "hello"))

(if  (defined? 'string-replace-substring )
        (d-WarningDialog "Defined")
        (d-WarningDialog "Not Defined"))
(d-WarningDialog (string-replace-substring "text" "t" ""))

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

So the first call shows that regexp-quote is being correctly loaded by
Denemo on startup while the second shows that, despite loading
ice9/string-fun module, the string-replace-substring is not being
found.
This script works correctly on my locally built Denemo, which, as I
say, uses essentially a default configure step, but fails on the
version from the Debian package.

So the bottom line is there seems to be a bug in guile 2.2 which
prevents this procedure being defined by including that module.
The guile-3.0-dev package was missing on my system. After installing it, Denemo is also compiles with guile 3 and with that your test script runs through successfully, and also the extended ToC script works. So, indeed, it looks like a bug in guile 2.2.

Andreas

Reply via email to