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