为什么 System.Reactive.Unit 没有被称为 System.Reactive.Void?
Is there any reason why System.Reactive.Unit wasn't called System.Reactive.Void?
主要是好奇。
我们的代码库中有一个名为 Unit
的对象 - 它表示桥梁或道路的组件。在我们的例子中,将带有 Unit
的 ReactiveUI 命令视为声明中的泛型之一可能会产生歧义。
即使在这个 old documentation 中(Google 没有向我指出当前文档的方向 - 无论在哪里),它说:
"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
。
主要是好奇。
我们的代码库中有一个名为 Unit
的对象 - 它表示桥梁或道路的组件。在我们的例子中,将带有 Unit
的 ReactiveUI 命令视为声明中的泛型之一可能会产生歧义。
即使在这个 old documentation 中(Google 没有向我指出当前文档的方向 - 无论在哪里),它说:
"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
。