English 中文(简体)
“被点击”和“被点击”符号之间的区别是什么。
原标题:What is the difference between an "interned" and an "uninterned" symbol

“被点击”和“被点击”符号之间的区别是什么。 是否只有没有被点击的标志,或者是否有其他的假肢或假肢?

最佳回答

中间符号是eq?,条件是并且只有名称相同。 未加封的符号不是eq?到任何其他编号上,因此,它们是一种独特的象征,有其附着。 中间符号是缺省读者生产的。 在宏观上形成编码时,可使用未加附标记作为识别符号,任何其他识别符号都不能掩盖这种识别特征。 大部分利什方言都有这种概念,在计划中,这种概念是少见的,因为卫生宏观应减少其效用。

问题回答

普通列席有未经处理的标志。 正如Juho的回答所说,保证不相隔的象征不等同于任何其他价值。

Common Lisp-style requires uninterned symbols in order to write many macros correctly (particularly macros whose expansion requires introducing and binding new variables), because any interned symbol you use in a macro expansion might capture or shadow a binding in its expansion site.

Scheme s hygienic macro systems, on the other hand, do not have this problem, so a Scheme system does not need to provide uninterned symbols. Still, many of them do. Why? Several reasons:

  • Some Scheme systems offer a Common Lisp-style defmacro capability.
  • In others, the hygienic macro system s implementation may use uninterned symbols internally, but the concept of an uninterned symbol may be exposed.
  • Uninterned symbols can be useful in many programs that use s-expressions to represent a language, and transform this language into another s-expr language. These sorts of tasks often benefit from an ability to generate an identifier guaranteed to be new.

然而,另外两个很好的答案却未提及通常相互交错的价值观,即它们可以随时加以比较。 这通常意味着这些数值在表格中代表,没有重复。 Racket,截至几个月前[*],其他价值-浮动点值和面字体,例如,也将受到干扰。 除了允许进行更快的比较外,我认为这能够更好地汇编时间上的优化,因为这些价值观可以比较平等,而不执行守则。

是否有类似情况的其他系统? 我没有。

[*] 如果我错的话,我相信有人会纠正:





相关问题
Parsing with DCGs in Scheme (without Prolog)?

Lots of Prolog-in-Scheme implementations are out there. E.g. Kanren, Schelog. Apparently in "Paradigms of AI Programming" Norvig implements Prolog-to-Lisp compiler in Lisp in order to use Definite ...

Applying a symbol as a procedure

Suppose I have a simple symbol: > + + Is there any way I can apply that symbol as a procedure: > ((do-something-with +) 1 2) 3 So that + is evaluated to the procedure +?

string-split in DrScheme

How do I do equivalent of python s str.split in DrScheme? SRFI-13 doesn t seem to have it provided.

Scheme, getting the pointer from pointed struct

Assume I have a such struct: (define-struct node (value next)) ;and making 2 nodes, parent pointing to child as next. (define child (make-node 2 null)) (define parent (make-node 1 child)) Under ...

How to solve the following equation using accumulate (Scheme)

I m trying to do the following problem (there is a formula so I print-screened and uploaded it) Formula http://img248.imageshack.us/img248/6558/problemh.jpg (http://img248.imageshack.us/img248/6558/...

热门标签