Are there languages compatible with .NET that don't support unsigned types?

有些话、适合烂在心里 提交于 2019-12-23 10:01:14

问题


Let's say that I'm writing a library in C# and I don't know who is going to consume it.

The public interface of the library has some unsigned types - uint, ushort. Apparently those types are not CLS-compliant and, theoretically speaking, there may be languages that will not be able to consume them.

Are there in reality languages like that?


回答1:


I believe in the original version of VB.NET, unsigned types were usable but there was no support for them built into the language. This has been addressed in later versions, of course.

Additionally, I suspect that the now-defunct J# has no support for unsigned types (given that Java doesn't have any).




回答2:


.NET compatibility and CLS compliance are two different things. Anything that can work in some way with the .NET framework could be said to be compatible with it. CLS compliance is more strict. It provides a set of rules for language implementors and library designers to follow so as to create an ecosystem of mutually compatible languages and libraries.

The whole point of a thing like the CLS is to allow you to avoid having to research every example of a language and figure out how to support them all. If you want to do that, you can, but the alternative is to comply with the CLS and therefore know that you will be compatible with anything else (from the past present or future) that also complies with the CLS.




回答3:


If there isn't one today, there may be one tommorow.




回答4:


Visual Basic..?



来源:https://stackoverflow.com/questions/364986/are-there-languages-compatible-with-net-that-dont-support-unsigned-types

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!