c# - 调用现场解释?

标签 c# .net .net-4.0 dynamic-language-runtime

浏览互联网,我无法以简单的方式理解 - 术语调用站点 (@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/

相关文章:

c# - 从 Windows 服务接收通知

c# - 使用C#在同一个进程中执行多个命令行

c# - 是否有 "AllIndexesOf"方法?

.net - Windows 应用程序图标文件

.net - Azure 存储 blob 的乐观并发始终抛出 HTTP 412

.net - 当我使用没有 OleDBConnection 对象的 OleDbDataAdapter 对象时,为什么我的 .NET 2.0 应用程序在 .NET 4.0 下崩溃?

c# - 替代具有保证交付的 Dataflow BroadcastBlock

c# - 为什么一个流在它的作者被处置时被处置?

wcf - web.config文件中compilation debug属性有什么影响?

c# - 要获得哪个VS 2010版本?