gpt4 book ai didi

c# - 调用现场解释?

转载 作者:可可西里 更新时间:2023-11-01 07:45:28 25 4
gpt4 key购买 nike

浏览互联网,我无法以简单的方式理解 - 术语调用站点 (@dlr)。我一直在读here CallSite 是:

一个网站说

The location in which the method is called.

一本书说:

call site . This is the sort of atom of the DLR - the smallest piece of codewhich can be considered as a single unit. One expression may contain a lot of call sites, but the behavioris built up in the natural way, evaluating one call site at a time. For the rest of the discussion, we'll onlyconsider a single call site at a time. It's going to be useful to have a small example of a call site to refer to,so here's a very simple one, where d is of course a variable of type dynamic

d.Foo(10); The call site is represented in code as a System.Runtime.CompilerServices.CallSite.

另一本书说:

the compiler emits code that eventually results in an expression tree that describes the operation, managed by a call site that the DLR will bind at runtime. The call site essentially acts as an intermediary between caller and callee.

抱歉,我无法看到这 3 个解释在哪里合并为一个简单的解释。

我很乐意得到一个简单的解释:

HOw can I explain my wife -what are call-sites ?

最佳答案

第一个解释与 dlr 或动态类型无关:简单来说,调用点是源代码中调用方法的位置(或站点)。 p>

在实现动态类型时,有必要存储有关代码中包含的动态方法调用的信息,以便在运行时调用它们(dlr 需要查找方法、解析重载等)。代表这些信息的对象也应该被称为“调用站点”,这似乎很自然。

关于c# - 调用现场解释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10861641/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com