all groups > c# > may 2007 >
You're in the

c#

group:

How can some features be supported by C# and not .NET?


Re: How can some features be supported by C# and not .NET? Marc Gravell
5/31/2007 2:32:14 PM
c#: As a suggestion - the string concatenation operator is provided by the
C# compiler, not the String class; this allows "a" + "b" + "c" + "d"
etc to be a single call (to String.Concat), not successive add
operations.

This might also refer to CLS compliance?

Marc
Re: How can some features be supported by C# and not .NET? Marc Gravell
5/31/2007 2:33:07 PM
Of course, re my last post, you could argue that this *is* supported,
precisely by calling string.Concat()...

Marc
Re: How can some features be supported by C# and not .NET? Marc Gravell
5/31/2007 3:49:18 PM
[quoted text, click to view]

That would be the other way around to the OP;
the classic example of CLR and not C# woud be
return-value overloading, which almost no
language supports, but which is legal CLR.

Marc
Re: How can some features be supported by C# and not .NET? Nicholas Paldino [.NET/C# MVP]
5/31/2007 5:35:13 PM
Fister,

One can interpret the first statement:

Some features are supported by.NET but not by C#

To mean that features that you see in the language are not necessarily
implemented in the language, but rather, in the framework. In this case, I
would say the type aliases, like int, string, etc, etc. The functionality
is provided by the framework.

As for the second statement, regarding operator overloading, .NET
doesn't support it outright. The language picks it up through specially
named static method signatures. VB now honors this convention as well, but
the framework doesn't enforce it.

I do think that the author could have phrased the second part a little
better.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

[quoted text, click to view]

How can some features be supported by C# and not .NET? Fister
5/31/2007 9:19:56 PM
I'm reading Professional C# (Wrox) and stumbled across:

"Some features are supported by.NET but not by C#, and you might be surprised
to learn that some features of the C# language are not supported by .NET
(for example, some instances of operator overloading)!"

How can some features be supported by C# and not .NET? Are there other features
than operator overloading and could someone please supply an example?

/ Fister

Re: How can some features be supported by C# and not .NET? Fred Mellender
5/31/2007 10:15:33 PM
They might be referring to features built into the CLR, and not exposed by
the C# language, but which might be used/exposed in some other .NET
language.

I'm not expert enough to give an example, but it *might* be that the CLR has
direct support for pointers and associated logic in order to implement C++,
but such features are not used/exposed/"supported" by C#.


[quoted text, click to view]

Re: How can some features be supported by C# and not .NET? Jon Skeet [C# MVP]
5/31/2007 10:37:50 PM
[quoted text, click to view]

It's just not supported as an addition operator on the string type.

Some of the nullable conversions may be similar - not sure.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Re: How can some features be supported by C# and not .NET? Jon Skeet [C# MVP]
5/31/2007 11:56:19 PM
[quoted text, click to view]

Another example is covariance and contravariance in generics - the CLR
has support for this (for interfaces) but C# doesn't expose it.

For more on this topic, see
http://blogs.msdn.com/rmbyers/archive/2005/02/16/375079.aspx

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
AddThis Social Bookmark Button