您将什么称为“回调”?或“关闭”一般来说?

发布于 2024-08-22 18:47:19 字数 155 浏览 7 评论 0原文

当我们为它们做笔记时,我们应该使用哪个关键字/标签来描述它们。

如果将它们放在“软件设计”类别下是否合适?

@edit:更多的是关于如何对事物进行分类。当你在学习的时候,会出现一些术语,那么你会把它归入你自己的本体中的哪一类呢?

Which keyword / tag should we use to describe them when we're taking notes for them.

If they are placed under the category "software design", is it appropriate?

@edit: It's more about how you category things. When you are in learning, some terminology appears, so what category will you assign it in your own ontology?

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

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

发布评论

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

评论(3

瑾夏年华 2024-08-29 18:47:19

是的,我怀疑我会在这里暴露我的愚蠢,但无论如何:

  • “回调”:一个函数(A)传递给另一个函数(B),它将在 B 中被调用来做工作。
  • “closure”:一个从定义范围内捕获变量值的函数

希望定义它们能够帮助您对它们进行分类 - 我不认为术语“callback”和“closure”实际上意味着同一件事,尽管根据上下文它们可以指同一件事。

我已经将这个答案制作成社区维基,所以请随意编辑它,直到它正确为止。

回调

关闭

  • http://en.wikipedia.org /wiki/Closure_(计算机科学)

    <块引用>

    术语“闭包”经常被错误地用来表示匿名函数。这可能是因为大多数实现匿名函数的语言允许它们形成闭包,并且程序员通常同时引入这两个概念。然而,这些是不同的概念

Right, I suspect I’m going to reveal my stupidity here, but anyway:

  • “callback”: a function (A) passed to another function (B), that’ll be called in B to do work.
  • “closure”: a function that captures the value of variables from the scope in which it was defined

Hopefully defining them will help you classify them — I don’t think the terms “callback” and “closure” actually mean the same thing, although they can both refer to the same thing depending on context.

I’ve made this answer community wiki, so please feel free to edit it until it’s correct.

callback

closure

  • http://en.wikipedia.org/wiki/Closure_(computer_science)

    The term closure is often mistakenly used to mean anonymous function. This is probably because most languages implementing anonymous functions allow them to form closures and programmers are usually introduced to both concepts at the same time. These are, however, distinct concepts

彩扇题诗 2024-08-29 18:47:19

我认为函数指针可以用作“回调”或“闭包”的标签。

I think Function Pointer can be used as tag for "callback" or "closures".

几度春秋 2024-08-29 18:47:19

我认为“闭包”和“回调”相关,但没有等同的地方。我想说两者之间的最低共同点是“高阶函数”,它发生在“函数式编程”中。

http://en.wikipedia.org/wiki/Higher_order_functions

http://en.wikipedia.org/wiki/Functional_programming

I consider "Closures" and "Callbacks" related but nowhere equivalent. The lowest common denominator between the two I would say are "Higher-Order Functions", which take place in "Functional Programming".

http://en.wikipedia.org/wiki/Higher_order_functions

http://en.wikipedia.org/wiki/Functional_programming

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