Q: how can I convert a 2-item list to a dotted pair cons
cell?
I can convert a 2-item list to a dotted pair with:
(let ((list '(1 2)))
(cons (car list) (cadr list))) ; => (1 . 2)
I'm blanking: is there a built-in function that does this, or should I roll my own?
'(1 2)
, your output as'(1 . 2)
and it will suggest(apply #'cons '(1 2))
for you!