Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 Emacs Lisp 中创建一对虚线变量。但我能找到的唯一方法似乎真的很笨拙。作为一个简化的例子:
(let ((width (calculate-width) (height (calculate-height)) `(,width . ,height))
这种反引号,双引号语法对我来说很臭,但是我找不到更整洁的方法,而且我的 Google-fu 让我失望了。
当值是变量时,是否有更好的方法来构造点对?
(为澄清起见,它必须是一个点对。直接列表是不行的。)
你可以使用cons:
cons
(let ((width (calculate-width)) (height (calculate-height)) (cons width height))