本文介绍了“ flet”和“ flet”之间有什么区别和“标签”在普通的Lisp中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是否与 setq setf 相似? flet labels 之间没有什么大不同?

Whether or not it is similar as setq and setf? There is no big difference between flet and labels?

致谢!

推荐答案

在Common Lisp中, flet labels 使词法绑定的类型稍有不同:

In Common Lisp, both flet and labels make lexical bindings of slightly different sorts:


  • flet 是本地函数绑定的一种特殊形式。 绑定不是递归的,不能互相引用。每个绑定都包含函数名称,参数和函数体。

  • flet is a special form for local function binding. Bindings are not recursive and cannot refer to each other. Each binding contains function name, arguments, and function body.

labels 是local的一种特殊形式。功能绑定。 绑定可以是递归的,并且可以互相引用。每个绑定都包含函数名称,参数和函数主体。

labels is a special form for local function binding. Bindings can be recursive and can refer to each other. Each binding contains function name, arguments, and function body.

在Emacs Lisp中,有很小的区别。 labels 格式类似于 flet ,不同之处在于它使用函数名称而不是动态绑定进行词法绑定。

In Emacs Lisp, there is a small difference. The labels form is like flet, except that it makes lexical bindings of the function names rather than dynamic bindings.

这篇关于“ flet”和“ flet”之间有什么区别和“标签”在普通的Lisp中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 07:59