From: Vincent Legoll <vincent.legoll@gmail.com>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: environment variable handling cleanup ?
Date: Sat, 28 Mar 2020 09:06:27 +0100 [thread overview]
Message-ID: <CAEwRq=oCtx7jViU6i4A2E5HvE99HcFuatzYuzdwrm5VaQMa-nA@mail.gmail.com> (raw)
In-Reply-To: <f674c83e-84a1-27b9-4ac3-d66285dcb9bd@crazy-compilers.com>
Hello,
since no one objected to the idea, I'm going forward with this.
On Mon, Mar 23, 2020 at 9:55 AM Hartmut Goebel
<h.goebel@crazy-compilers.com> wrote:
> Well, I did not count how often this is used, but (guix built utils
> update-env) might benefit from this, to.
I don't know if you meant that (guix build utils) was the right place
to put those helpers, or if you were hinting me at a place where I
can use them, or both.
It looks like there is something that they can replace in this file:
(wrap-script ... (update-env ...))
But...
[reordering email content]
> > Another question is the usefulness of the separator parameter,
> > as I think all target cases use ":", so hardcoding it would be a
> > sensible choice.
>
> I doubt there is a need for different separators. The path separator is
> defined to be ":" in Posix. So I'd suggest to use a hardcoded value.
To replace (update-env ...) code, I will need to keep separator as a
parameter, since some cases in the match-lambda don't use an
hardcoded ":".
What should I do there ?
Can you clarify ?
> > There's also the added (or (getenv ...) "") which is not present in
> > all target cases.
>
> I suggest to default the value to #f (False), since - depending on the
> variables semantic - it may make a difference whether the variabel is
> empty or actually unset. This is especially true when used within a
> programming language like Scheme which has a notion of "False" - which
> env-vars do not have.
OK, I'll do that, I'll just remove the (or (getenv ...) default-value) as the
return value for getenv on a non-existent variable is already #f
Thanks
--
Vincent Legoll
prev parent reply other threads:[~2020-03-28 8:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-22 14:40 environment variable handling cleanup ? Vincent Legoll
2020-03-23 8:54 ` Hartmut Goebel
2020-03-28 8:06 ` Vincent Legoll [this message]
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://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAEwRq=oCtx7jViU6i4A2E5HvE99HcFuatzYuzdwrm5VaQMa-nA@mail.gmail.com' \
--to=vincent.legoll@gmail.com \
--cc=guix-devel@gnu.org \
--cc=h.goebel@crazy-compilers.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).