gpt4 book ai didi

system.reactive - System.Reactive.Unit 不叫 System.Reactive.Void 有什么原因吗?

转载 作者:行者123 更新时间:2023-12-01 00:14:26 27 4
gpt4 key购买 nike

主要是我很好奇。

我们有一个名为 Unit 的对象在我们的代码库中 - 代表桥梁或道路的组件。在我们的例子中,看到带有 Unit 的 ReactiveUI 命令可能会模棱两可。作为声明中的泛型之一。

即使在这个 old documentation (谷歌没有指出我当前文档的方向——无论在哪里),它说:

"Represents void."



所以现在我想知道,术语 Unit 背后有什么含义吗? .他们怎么不直接叫它 System.Reactive.Void ?

最佳答案

引用维基百科(它也给出了使用相同名称的其他语言的例子)

a unit type is a type that allows only one value (and thus can hold no information).



在这种情况下,该值为 Unit.Default .

关于system.reactive - System.Reactive.Unit 不叫 System.Reactive.Void 有什么原因吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54336641/

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