What's the difference between “flet” and “labels” in Common Lisp?

前端 未结 1 717
余生分开走
余生分开走 2020-12-30 19:59

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

Sincerely!

相关标签:
1条回答
  • 2020-12-30 20:16

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

    • 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 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.

    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.

    0 讨论(0)
提交回复
热议问题