I'm trying to setup activating virtual environments conditional on hostname.
Until recently I've been using...
(pyvenv activate "~/.virtualenv/default")
...across all hosts, but because work laptop is locked down and stuck on an old (3.6.9) version that isn't going to get updated any time soon and I've have started using features of Python 3.8.3 I've switched to using the Conda Virtual Environment which is installed in
(setq virtualenv-byhost '(("kimura" . "~/.virtualenvs/python3_9") ("work" . "~/.miniconda3/")))
Next step though has me a little stumped since I'm still getting started with Lisp and haven't sat down and started learning it formally.
(pyvenv-activate (cdr (assoc system-name virtualenv-byhost)))
If I understand it
(assoc system-name virtualenv-byhost) associates whatever
system-name returns with the
virtualenv-byhost, but how does it know which to pick and pass onto the parent
pyvenv-activate? Is that what
cdr is doing and if so what is it doing and how?