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.goe...@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