解开(c)=> C()

发布于 2025-02-04 05:40:53 字数 432 浏览 0 评论 0原文

我有一个问题:(c)=>我发现在这里 ://stackoverflow.com/questions/51227165/what-does-foreachc-c-mean-in-dart“> where 。 我知道它可以定义一个具有未型参数的匿名函数c。但是它似乎是指

  • 无参数的未定义函数c(),即具有与初始匿名函数的参数相同的名称,
  • 或者是其自己的参数C,就好像此非常参数是无参数的未定义函数本身。

我很确定我没有正确地做到这一点,而且我错过了重点,但是任何提示都会有助于解开(c)和c(),并掌握功能最终的真实作用。

I have an issue with : (c) => c() which I found here and there.
I understand that it defines an anonymous function with an untyped parameter, c. But then it seems to refer

  • to a parameter-free undefined function c(), i.e. having the same name as the parameter of the initial-anonymous function,
  • or to its own parameter c as if this very parameter were a parameter-free undefined function it-self.

I'm pretty sure that I did not get it right and that I miss the point, but any hint would help to untangle (c) and c(), and grasp what the function ends up doing for real.

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

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

发布评论

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

评论(1

春庭雪 2025-02-11 05:40:53

这是一个匿名功能,可以获取名为c的东西。然后调用它的收到的函数好像是一个函数。这意味着编译器发现它是是没有参数的函数,或者是dynamic。否则,编译器会抱怨。

因此,英语:一个名为c的参数的匿名函数。该参数的类型是“无参数的函数”。然后调用它刚刚获得的函数。

It is an anonymous function that gets something named c. It then calls what it gets as if it were a function. That implies that the compiler figured out that it either is a function with no parameters, or it is a dynamic. Otherwise the compiler would have complained.

So in english: an anonymous function that has a parameter named c. The type of that parameter is "function with no parameters". It then calls the function it just got as argument.

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