普通Lisp是Lisp-n吗? [英] Common Lisp a Lisp-n?

查看:91
本文介绍了普通Lisp是Lisp-n吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Common Lisp对于函数和变量具有不同的绑定环境,但是我相信它对于标签主体标签也具有另一个绑定环境.是否有比这更多的绑定环境?如果是这样,那么将Common Lisp归类为Lisp-2是否公平?

I'm aware that Common Lisp has different binding environments for functions and variables, but I believe that it also has another binding environment for tagbody labels. Are there even more binding environments than this? If so, then is it fair to categorize Common Lisp as a Lisp-2?

这些问题并不意味着要进行修脚或骑自行车,我只是想更好地了解Common Lisp,并希望能找到一些指向何处更深入了解其规格的指针.

These question are not meant as pedantry or bike-shedding, I only want to gain a better understanding of Common Lisp and hopefully get some pointers into where to dig deeper into its spec.

推荐答案

我知道Common Lisp具有不同的绑定环境 函数和变量,

I'm aware that Common Lisp has different binding environments for functions and variables,

根据

命名空间1.绑定 特殊种类. The bindings of names to tags is the tag namespace.'' 2. any mapping whose domain is a set of names. A 程序包定义了一个名称空间.''

namespace n. 1. bindings whose denotations are restricted to a particular kind. The bindings of names to tags is the tag namespace.'' 2. any mapping whose domain is a set of names.A package defines a namespace.''

(第1点)

但是我相信它也为标记体提供了另一个绑定环境 标签.还有比这更多的绑定环境吗?

but I believe that it also has another binding environment for tagbody labels. Are there even more binding environments than this?

是的,还有更多的名称空间.我什至还记得一个片段,这些片段暴露了其中的大多数,但不幸的是,我找不到它了¹.它至少公开了变量函数标签 block 名称空间,但可能还公开了 types 声明.还有另一个SO答案,其中列出了这些命名空间.

Yes, there are more namespaces. I even remember a little snippet exposing most of them, but unfortunately, I can't find it anymore¹. It at least exposed variable, function, tag, and block namespaces, but maybe also types and declarations were included. There is also another SO answer that lists these namespaces.

如果是这样,那么将Common Lisp归类为Lisp-2是否公平?

If so, then is it fair to categorize Common Lisp as a Lisp-2?

在上述链接答案的评论中,Rainer Joswig同意一般性辩论是关于Lisp-1反对Lisp-n".

In the comments to the above linked answer, Rainer Joswig agrees that the "general debate is about Lisp-1 against Lisp-n".

"2"可能是由于值和函数槽之间的区别的相对重要性,或者是因为其他名称空间的对象不是一流的对象.例如,在另一个答案中引用的 Gabriel/Pitman论文中:

The "2" might be due to the relative importance of the distinction between value and function slots, or because the objects of the other namespaces aren't first-class objects. For example in the Gabriel/Pitman paper referenced in the other answer:

实际上,存在的命名空间数量远远超过了两个命名空间 在这里讨论.如前所述,其他名称空间包括 至少是块和标签的那些;类型名称和声明名称是 通常被认为是名称空间.因此,我们命名为Lisp1和Lisp2 一直在使用会产生误导. Lisp5和Lisp6的名称可能是 更合适.

There is really a larger number of namespaces than just the two that are discussed here. As we noted earlier, other namespaces include at least those of blocks and tags; type names and declaration names are often considered namespaces. Thus, the names Lisp1 and Lisp2, which we have been using are misleading. The names Lisp5 and Lisp6 might be more appropriate.

和:

在本文中,有两个值得关注的命名空间,我们 应称为值名称空间"和功能名称空间".其他 名称空间包括标签名称(由TAGBODY和GO使用)和块名称 (由BLOCK和RETURN-FROM使用),但位置部分中的对象 它们的绑定不是一流的Lisp对象.

In this paper, there are two namespaces of concern, which we shall term the "value namespace" and the "function namespace." Other namespaces include tag names (used by TAGBODY and GO) and block names (used by BLOCK and RETURN-FROM), but the objects in the location parts of their bindings are not first-class Lisp objects.


¹) PAIP ,第p. 837:


¹) PAIP, p. 837:

(defun f (f)
  (block f
    (tagbody
     f (catch 'f
         (if (typep f 'f)
             (throw 'f (go f)))
         (funcall #'f (get (symbol-value 'f) 'f))))))

这篇关于普通Lisp是Lisp-n吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆