Emacs Lisp的功能名称内部意味着什么? [英] What does internal mean in function names in Emacs Lisp?

查看:149
本文介绍了Emacs Lisp的功能名称内部意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些人使用双击表示该功能可能会更改:
在Emacs Lisp中,函数名称中的双减( - )约定是什么意思

Some people use double dash to indicate that the function is subject to change: What does the double minus (--) convention in function names mean in Emacs Lisp

在功能名称中包含 internal 是否类似?

Does including internal in function names mean similar things?

两个示例

where-is-internal
internal-make-var-non-special

功能 where-is-internal 具有详细的docstring,并在手册中提及。 where-is-internal 一个例外?

The function where-is-internal has a detailed docstring and is mentioned in the manual as well. Is where-is-internal an exception?

之间有区别 - 内部作为后缀,并将 internal - 作为前缀

Is there a difference between having -internal as suffix and having internal- as prefix?

添加到混乱,那里也是具有 internal - (用双击)作为前缀的函数名。

Adding to confusion, there are also function names with internal-- (with double dash) as prefix.

推荐答案

这个混乱不仅在于命名约定(由于历史而引起的变化,也许有时候会引起争议)。混淆是在免费软件中的内部的概念中,其中源代码可供所有人使用或修改(甚至叉),因为他们愿意。

The confusion is not just in the naming convention (variability due to history and perhaps sometimes whim). The confusion is in the very notion of "internal" in free software, where the source code is open to everyone to use or modify (even fork) as they please.

为了回答你的问题(我认为是什么)Emacs Dev的观点,因此根据潜在的意图:内部意味着使用这种功能的人可能更有可能遇到Emacs-Dev实现的未来变化以及该功能的使用可能与非内部功能的情况相同。 IOW,你可能不想指望它现在剩下的。就是这样。

To answer your question from (what I think is) the point of view of Emacs Dev, and thus in terms of the underlying intention: "internal" means that someone using such a function is perhaps more likely to encounter future changes in the Emacs-Dev implementation and use of that function than might be the case for a non-"internal" function. IOW, you might not want to count on it remaining as it is now. That's all.

但是有很多可能,更有可能和可能在那里。在实践中,一些非内部功能比一些内部功能更加彻底地或更快地变化。可能的情况是,对于前者,会有一个弃权宽限期,在此期间可以容忍改变前的情况,即仍然工作。 内部的内容可能不是这样。但是,实际上,在内部的黑色和非内部的白色之间有一些灰色。

But there's a lot of "perhaps", "more likely", and "might" in there. In practice, some non-"internal" functions change more radically or more quickly than some "internal" functions. It might be the case that for the former there will be a deprecation grace period, during which the pre-change situation is tolerated, i.e., still works. That might not be the case for something "internal". But again, in practice there is some gray between the black of "internal" and the white of non-"internal".

来自Emacs Dev的人(例如@Stefan)可能会这样做不一样或正确我的解释。

Someone from Emacs Dev (e.g. @Stefan) will perhaps put this differently or correct my interpretation.

我自己的采取:有时(往往)是作者没有期望用户使用的功能和变量直接地,因此自然地被认为是内部,用户仍然使用,甚至使用(模数重写代码)。有些这样的事情已经把他们的内部状态消除了(不,我没有记录例子)。或者有时添加一个新的,非内部函数来使行为可用 - 例如,添加了一个包装器或函数值参数(再次,我没有给出的例外)。

My own take: there have sometimes (often) been functions and variables that the author did not expect users to make use of directly, and thus naturally thought of as "internal", which users have nevertheless put to good use, or even "had" to use (modulo rewriting lots of code). Some such have had their "internal" status removed (no, I don't have examples memorized). Or sometimes a new, non-"internal" function has been added to make the behavior available - e.g., a wrapper or function-valued argument has been added (again, I have no offhand examples to give).

IOW,对于Emacs Dev来说,并不总是清楚应该考虑什么内部。只需将标签作为标记,您可能不想对该函数或变量进行太多的计数。

IOW, for Emacs Dev too it is not always clear what should be considered "internal". Just take the label as a flag that you might not want to count too much on that function or variable.

写出各种符号:我的印象是 - 惯例似乎最近被使用更多(尽管也有一些使用它的旧代码);使用 internal 是一个较旧的约定,大部分是

Wrt the various notations: My impression is that the -- convention seems recently to be used more (though there is also some old code that uses it); using internal is an older convention, for the most part.

这篇关于Emacs Lisp的功能名称内部意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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