Common Language Specification (CLS)
The CLI defines a runtime that is capable of supporting most, if not all, of the features found in modern programming languages. It is not intended that all languages that target the CLR will support all CLR features. This could cause problems when components written in different languages attempt to interoperate. The CLI therefore defines a subset of features that are considered compatible across language boundaries. This subset is called the Common Language Specification (CLS).
Vendors creating components for use by others need to ensure that all externally visible constructs (e.g., public types, public and protected methods, parameters on public and protected methods, etc.) are CLS-compliant. This ensures that their components will be usable within a broad array of languages, including Visual Basic .NET. Developers authoring components in Visual Basic .NET have an easy job because all Visual Basic .NET code is CLS-compliant (unless the developer explicitly exposes a public or protected type member or method parameter that is of a non-CLS-compliant type).
Because Visual Basic .NET automatically generates CLS-compliant
components, this book does not describe the CLS rules. However, to
give you a sense of the kind of thing that the CLS specifies,
consider that some languages support a feature called
operator overloading
.
This allows the developer to specify actions that should be taken if
the standard operator symbols (+,
-, *, /,
=, etc.) ...