guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's up with 'current-load-port'


From: Ludovic Courtès
Subject: Re: What's up with 'current-load-port'
Date: Mon, 05 Nov 2018 11:14:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi Thomas,

Thomas Morley <address@hidden> skribis:

> Recently a user wrote a large scm-file and put it into lilypond using
> '(load file.scm)'.
> No problem with guilev1, but with guilev2 'file.scm' is not found.

In Guile 2.x, there’s a compilation step that did not exist in 1.8, so
the question of how to resolve relative file names passed to ‘load’
becomes trickier.

What Guile 2.x does is that ‘load’ is now a macro that attempts to
resolve file names relative to the location of the *source* file.  So if
you have a.scm and b.scm in the same directory, and a.scm does:

  (load "./b.scm")

then b.scm is searched for in the same directory as a.scm.

Of course if you use an absolute file name, that logic doesn’t come into
play.

I would recommend using modules to the extent possible, or using things
like:

  (search-path %load-path "file.scm")

when you want to search for a file at run time.

HTH!

Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]