unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Ian Hulin <ian@hulin.org.uk>
To: Ian Price <ianprice90@googlemail.com>
Cc: 10326@debbugs.gnu.org
Subject: bug#10326: Need to document %load-path, %load-compiled-path, and add %search-load-compiled-path and load-compiled-from-path to API
Date: Sat, 24 Dec 2011 12:22:34 +0000	[thread overview]
Message-ID: <4EF5C40A.5010400@hulin.org.uk> (raw)
In-Reply-To: <87liq297gt.fsf@Kagami.home>

Hi Ian,
On 23/12/11 23:46, Ian Price wrote:
> Ian Hulin <ian@hulin.org.uk> writes:
> 
>> Section 6.17.6 of the manual could do with a sections for
>> %load-path and %load-compiled-path.
>> 
>> e.g. — Variable: %load-path
>> 
>> The list of directories which will currently be searched by 
>> load-from-path, primitive-load-path and %search-load-path to
>> locate a scheme file.
>> 
>> - Variable: %load-compiled-path
>> 
>> The list of directories which will currently be searched by 
>> load-compiled-from-path and %search-load-compiled-path to locate
>> a compiled scheme file.
> 
> %load-path is already documented in 2.0, in section 6.22.1, 6.17.6
> may be a better place for it though, as that is where e.g.
> %search-load-path, %load-hook etc. are.
> 
Or a cross-ref,or move it from 6.22 and put the cross-ref in here,
depending on Guile's documentation policies.
> %load-compiled-path seems to be only indirectly referred to in the 
> %documentation for GUILE_LOAD_COMPILED_PATH and
> compiled-file-name.
> 
>> Also, Guile really needs to provide a %search-load-compiled-path
>> and a load-compiled-from-path, it would have been useful in
>> LilyPond code, and Manual Section 4.7 (discussing site locations
>> says)
> 
> I don't see a %search-load-compiled-path or load-compiled-from-path
> in guile 2.0's stable branch. Where these removed? Or have I missed
> them?
> 
I don't think they were ever implemented.
>> "As with Scheme files, Guile searches a path to find compiled
>> .go files, the %load-compiled-path. By default, this path has two
>> entries: a path for Guile's files, and a path for site packages.
>> You should install your .go files into the latter. Currently
>> there is no procedure to get at this path, which is probably a
>> bug."
>> 
>> 
>> — Scheme Procedure: %search-load-compiled-path filename — C
>> Function: scm_sys_search_load_compiled_path (filename)
>> 
>> Search %load-compiled-path for the file named filename, which
>> must be readable by the current user. If filename is found in the
>> list of paths to search or is an absolute pathname, return its
>> full pathname. Otherwise, return #f.
> 
> Unless you meant %search-load-compiled-path, this sounds similar to
> the documented procedure 'compiled-file-name'
No: compiled-file-name does more and different things which are
intimately linked in to --auto-compile and its related cache.

If you're compiling things to locations outside of this cache (as we
need to do for LilyPond) you need to set a directory as an entry in
%load-compiled-path and pass this explicitly to compile-file (guild
compile if your doing this from within a build environment).

We then need to have custom code to load the compiled files during
startup. This is because the built-in things in load-from-path et al.
rely on compiled-file-name which don't do the right thing if you're
compiling to a location outside the --auto-compile cache.

So. . . if we want to load our compiled scheme files, possibly
produced from guild compile in a build, outside of the --auto-compile
cache, we have to use load-compiled, which explicitly says "Load the
compiled file named /filename/.  The load paths are not searched."

>> 
>> — Scheme Procedure: load-compiled-from-path filename
>> 
>> Similar to load-compiled, but searches for filename in the 
>> compiled load paths.
> If the above is correct, this is just (compose load-compiled
> compiled-file-name), yes?
No.  See above
> Might be useful for symmetry with 'load-from-path'
> 
Yes.

Cheers,
Ian Hulin





  reply	other threads:[~2011-12-24 12:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-19 15:00 bug#10326: Need to document %load-path, %load-compiled-path, and add %search-load-compiled-path and load-compiled-from-path to API Ian Hulin
2011-12-23 23:46 ` Ian Price
2011-12-24 12:22   ` Ian Hulin [this message]
2012-01-27 12:20 ` Andy Wingo
2013-03-10 22:22   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EF5C40A.5010400@hulin.org.uk \
    --to=ian@hulin.org.uk \
    --cc=10326@debbugs.gnu.org \
    --cc=ianprice90@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).