I want to create a dotted pair of variables in Emacs Lisp. But the only way I can find to do it seems really unwieldy. As a simplified example:
(let ((width (calculate-width)
(height (calculate-height))
`(,width . ,height))
This backquote, double-unquote syntax smells to me, but I can't find a neater way and my Google-fu is failing me.
Is there a better way to construct a dotted pair when the values are variables?
(For clarification, it must be a dotted pair. A straight list won't do.)
You could use cons
:
(let ((width (calculate-width))
(height (calculate-height))
(cons width height))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With