Re: Environment variables and other alists with string keys
Lassi Kortela 03 Dec 2019 15:31 UTC
> Those lists could be flattened:
>
> (environment "TERM=screen" "LANG=en_US.UTF-8")
> (java-system-properties "java.vm.name=OpenJDK 64-Bit Server VM")
Or slashes could be used for namespacing:
(env/TERM "screen")
(env/LANG "en_US.UTF-8")
(java-system-properties/java.vm.name "OpenJDK 64-Bit Server VM")
(java-system-properties/java.vm.version "12+33")
This seems the best alternative to me:
* Scheme code can just do (assoc 'env/LANG ...) instead of manually
splitting strings at #\= to get the name and value.
* Awk, grep|sed and other regexp tools can work with them like normal
properties.
* Don't need to worry about how to merge multiple (env ...) lines into
one alist.