“接收者”的等效术语非 Objective-C 语言

发布于 2024-10-10 06:32:08 字数 250 浏览 0 评论 0原文

在 Objective-C 中,当你有

[A something]

A 时,A 被称为“接收者”。我想知道其他面向对象语言中的等效术语是什么,特别是方法调用语言而不是消息传递语言。

我认为调用者/被调用者指的是实际方法本身,而不是对象。另外,我不确定“实例”,因为在我正在使用的语言中,Vala,您实际上可以调用结构和名称空间上的方法,而您不会将其归类为对象或实例。

人们的想法是什么?

In Objective-C when you have

[A something]

A is referred to as the 'receiver'. I am wondering what the equivalent term is in other object-orientated languages, particularly method calling ones as opposed to message passing ones.

Caller/Callee refers to the actual methods themselves I think, not the object. Also I'm not sure about 'instance' as in the language I'm working with, Vala, you can actually call methods on structs and namespaces, which you wouldn't classify as objects or instances.

What are people's thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

肩上的翅膀 2024-10-17 06:32:08

我认为最常见的术语就是“对象”。在Python 中,它传统上称为self

I think the most common term is just "the object". In Python it is traditionally called self.

流心雨 2024-10-17 06:32:08

它是方法调用而不是消息传递,因此另一个常见术语(特别是在 Perl 黑客中)是invocant

当您调用方法时,您是通过调用者来执行的。调用者。当您对 Cat 调用 new() 时,类的名称 Catnew()' s 调用者。 [...] 当您调用对象上的方法时,该对象就是调用者。

-- 半音阶,现代 Perl

It's method-invoking rather than message-passing, so another common term, particularly among Perl hackers, is invocant.

When you call a method, you do so with an invocant. When you call new() on Cat, the name of the class, Cat, is new()'s invocant. [...] When you call a method on an object, that object is the invocant.

-- chromatic, Modern Perl

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文