Re: set-environment-variable Lassi Kortela 07 Dec 2019 16:23 UTC
>> an overwrite argument >> >> It is worthwhile to add this to the SRFI 170 API, as, say, an >> optional argument, defaulting to overwrite? > > I've never seen anyone use it... People always want to overwrite the old value. > Therefore I suggest leaving out the option from the Scheme API. Another option would be something like: (get-environment-variable name [default-value]) (update-environment-variable! name proc [default-value]) Where the signature of proc is (lambda (old-value) ...) => new-value and old-value is the old value of the envar (of default-value if the envar is not yet defined). If default-value is not given, it defaults to #f. This is probably also overkill?