From: Andreas Rottmann <a.rottmann@gmx.at>
To: Ian Price <ianprice90@googlemail.com>
Cc: guile-devel@gnu.org
Subject: Re: Adding to the end of the load path
Date: Thu, 08 Nov 2012 02:03:12 +0100 [thread overview]
Message-ID: <87liecucrz.fsf@delenn.home.rotty.xx.vu> (raw)
In-Reply-To: <87sj8o20v0.fsf@googlemail.com> (Ian Price's message of "Mon, 05 Nov 2012 03:18:59 +0000")
[-- Attachment #1: Type: text/plain, Size: 877 bytes --]
Ian Price <ianprice90@googlemail.com> writes:
> Hi guilers,
>
> On the #guile IRC channel, Mark Weaver has stressed to me that he thinks
> it would be a good idea for us to be able to add paths to the end of the
> load path, since it would allow us to, for example, prefer a built-in guile
> implementation over a guildhall provided one, when this exists. Right
> now, for the srfi[0] and guile-lib, I have handled this by not adding
> files to the package where they have been adopted by guile (e.g. statprof).
>
> Andreas Rottmann suggested something similar in February[1].
>
I've attached a patch implementing that suggestion, FWIW.
> I don't have any concrete proposals better than what Andreas has
> suggested, but I felt I should make this post to the list, lest Mark and
> I forget.
>
[...]
> 1. http://lists.gnu.org/archive/html/guile-devel/2012-02/msg00038.html
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-More-flexible-load-path-and-load-compiled-path-handl.patch --]
[-- Type: text/x-diff, Size: 1855 bytes --]
From 1f72ddd3971a796a6f83a68ebedde7d7324c50b5 Mon Sep 17 00:00:00 2001
From: Andreas Rottmann <a.rottmann@gmx.at>
Date: Thu, 8 Nov 2012 01:59:56 +0100
Subject: [PATCH] More flexible %load-path and %load-compiled-path handling
---
libguile/load.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/libguile/load.c b/libguile/load.c
index af2ca45..a05cf76 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -226,7 +226,9 @@ SCM_DEFINE (scm_parse_path, "parse-path", 1, 1, 0,
"Parse @var{path}, which is expected to be a colon-separated\n"
"string, into a list and return the resulting list with\n"
"@var{tail} appended. If @var{path} is @code{#f}, @var{tail}\n"
- "is returned.")
+ "is returned. In case an empty string occurs as an element\n"
+ "of @var{path}, @var{tail} is inserted at that point instead of\n"
+ "being append at the end of the list.")
#define FUNC_NAME s_scm_parse_path
{
#ifdef __MINGW32__
@@ -237,9 +239,24 @@ SCM_DEFINE (scm_parse_path, "parse-path", 1, 1, 0,
if (SCM_UNBNDP (tail))
tail = SCM_EOL;
- return (scm_is_false (path)
- ? tail
- : scm_append_x (scm_list_2 (scm_string_split (path, sep), tail)));
+ if (scm_is_false (path))
+ return tail;
+ else
+ {
+ SCM elements = scm_string_split (path, sep);
+ SCM seen = SCM_EOL;
+ SCM rest = elements;
+
+ for (; scm_is_pair (rest); rest = SCM_CDR (rest))
+ {
+ if (scm_is_true (scm_string_null_p (SCM_CAR (rest))))
+ return scm_append_x (scm_list_2 (scm_reverse_x (seen, tail),
+ SCM_CDR (rest)));
+ seen = scm_cons (SCM_CAR (rest), seen);
+ }
+
+ return scm_append_x (scm_list_2 (elements, tail));
+ }
}
#undef FUNC_NAME
--
1.7.10.4
[-- Attachment #3: Type: text/plain, Size: 63 bytes --]
Regards, Rotty
--
Andreas Rottmann -- <http://rotty.yi.org/>
next prev parent reply other threads:[~2012-11-08 1:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-05 3:18 Adding to the end of the load path Ian Price
2012-11-08 1:03 ` Andreas Rottmann [this message]
2012-11-11 7:50 ` Mark H Weaver
2012-11-11 19:02 ` Andreas Rottmann
2012-11-11 21:51 ` Mark H Weaver
2012-11-12 16:35 ` Bruce Korb
2012-11-13 21:04 ` Ludovic Courtès
2012-11-15 22:06 ` Andreas Rottmann
2012-11-15 22:37 ` Ludovic Courtès
2012-11-15 22:44 ` Mark H Weaver
2012-11-15 23:06 ` Ludovic Courtès
2012-11-16 0:10 ` Noah Lavine
2012-11-16 14:00 ` Noah Lavine
2012-11-16 18:06 ` Bruce Korb
2012-11-16 18:52 ` Mark H Weaver
2012-11-16 21:38 ` Noah Lavine
2012-11-28 23:12 ` [PATCH] Add parse-path-with-ellipsis, and use it for GUILE_LOAD_PATH et al Mark H Weaver
2012-11-28 23:46 ` Ludovic Courtès
2012-11-29 3:04 ` Mark H Weaver
2012-11-29 10:27 ` Ludovic Courtès
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=87liecucrz.fsf@delenn.home.rotty.xx.vu \
--to=a.rottmann@gmx.at \
--cc=guile-devel@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).