Conversion Operators

What’s Different in the Revised Language Definition? Conversion Operators       Speaking of that grotty feel to the language, having to write op_Implicit to specify a conversion just didn’t feel like C++ in the T1 language design. For example, here is a definition of MyDouble taken from the T1 language specification:   __gc struct…

2

Declaring Delegates and Events

What’s Different in the Revised Language Definition? Delegates and Events       The only change to the declarations of a delegate and a trivial event is the removal of the double underscore, as in the following sample. As these things go, this has proved to be completely non-controversial (J). That is, there have been…

3

Declaring Indexed Properties

What’s Different in the Revised Language Definition? Declaring Indexed Properties     In an earlier entry on operator overloading, I showed the following construction, in which the x-coordinate of a managed reference Vector class object is directly accessed using an indexed property, as follows:   int main() {        Vector^ p2 = gcnew Vector( 1.475…

2

Property Declarations

What s Different in the Revised Language Definition? Declaring Properties In the original language design, each set or get property accessor is specified as an independent member function. The declaration of each method is prefixed with the __property keyword. The method name begins with either set_ or get_ followed by the actual name of the…

7

Implicit Boxing

What s Different in the Revised Language Definition? Implicit Boxing     Ok, so we reversed ourselves. In politics, that would likely loose us an election. In language design, it means that we imposed a philosophical position in lieu of practical experience with the feature and, in practice, it was a mistake. As an analogy,…

14

Declaration and Use of Overloaded Operators

What s Different in the Revised Language Definition? Support for Operator Overloading     Perhaps the most baffling aspect of the original language design is its support for operator overloading or rather, its effective absence. As an outsider, I took it as evidence of an abandonment, and felt this absolutely required fixing if Microsoft was…

3

The Declaration of a Managed Enum

What s Different in the Revised Language Definition? The Declaration of a Managed Enum Type   The original .NET enum declaration is preceded by the __value keyword. For example,   // the original syntax public __value enum e1 : unsigned short  { not_ok = 1024, maybe, ok = 2048 }; __value enum e2 { fail,…

3

The Declaration of a Managed Class

What s Different in the Revised Language Definition? The Declaration of a Managed Class Type     In the original language definition, a reference class type is prefaced with the __gc keyword, where the gc is an acronym for garbage collected. In the revised language, the __gc keyword is replaced by one of two spaced…

5

Removal of the __ Keyword Prefix

What s Different in the Revised Language Definition? Removal of the  __ Keyword Prefix One general transformation of the language between the original and revised language design is the removal of the double-underscore from all keywords. For example, a property is now declared as property, not __property, and so on. Why Did We Originally Use…

4

Finishing the Hat

    Finishing the Hat (^) Once it became clear that support for .NET within C++ represented a distinct programming paradigm, it followed that the language needed to be extended to provide both a first class coding experience for the user, and an elegant design integration with the ISO C++ standard in order to respect…

6