Questions tagged «lisp»

3
什么时候/为什么应该使用progn?
progn浏览经验丰富的Emacs用户的配置文件时,已经看到了很多使用情况。我找到了这个很好的解释progn,但是我真正好奇的是,使用此功能的好处是什么?以以下片段为例(摘自Sacha Chua的配置): (use-package undo-tree :defer t :ensure t :diminish undo-tree-mode :config (progn (global-undo-tree-mode) (setq undo-tree-visualizer-timestamps t) (setq undo-tree-visualizer-diff t))) 上面的配置与此之间有什么主要区别吗? (use-package undo-tree :defer t :ensure t :diminish undo-tree-mode :config (global-undo-tree-mode) (setq undo-tree-visualizer-timestamps t) (setq undo-tree-visualizer-diff t)) 我觉得第一个示例在某种程度上来说更干净,尽管它具有更多的语法,并且我的直觉是使用可能会带来某种性能提升progn,但是我不确定。感谢您的任何见解!
19 lisp 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.