“实习生"和“实习生"有什么区别?和一个“未实习的"象征 [英] What is the difference between an "interned" and an "uninterned" symbol

查看:81
本文介绍了“实习生"和“实习生"有什么区别?和一个“未实习的"象征的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

interned"和uninterned"符号有什么区别.是只有 Racket 有未嵌入的符号,还是其他 scheme 或 lisp 的方言有它们?

What is the difference between an "interned" and an "uninterned" symbol. Is it only Racket that has uninterned symbols or do other dialects of scheme or lisp have them?

推荐答案

Interned 符号是 eq? 当且仅当它们具有相同的名称.Uninterned 符号不是 eq? 任何其他符号,因此它们是一种带有附加字符串的唯一标记.内部符号是由默认阅读器生成的类型.在宏中生成代码时,非内部符号可以用作标识符,这样的标识符不能被任何其他标识符遮蔽.大多数 Lisp 方言都有这个概念,在 Scheme 中很少见,因为卫生宏应该会降低其实用性.

Interned symbols are eq? if and only if they have the same name. Uninterned symbols are not eq? to any other symbol, so they are a kind of unique token with an attached string. Interned symbols are the kind that are produced by the default reader. Uninterned symbols can be used as identifiers when generating code in a macro, such an identifier cannot be shadowed by any other identifier. Most Lisp dialects have this concepts, in Scheme it is rarer, since hygienic macros are supposed to reduce its usefulness.

这篇关于“实习生"和“实习生"有什么区别?和一个“未实习的"象征的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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