[Mono-devel-list] ECMA verrsions of C#

Matthias Kempka lists at mkempka.de
Thu Jul 1 06:14:12 EDT 2004


Jonathan Pryor wrote:

> Consequently, in order to use the new language features, you need to
> tell the Java compiler which language version you're using with the
> -source parameter:
> 
> 	javac -source 1.5 my-generics-using-code.java
> 
> Compare this with C#, where they evolved the language so that older
> source would still be compatible under the current compiler.  No new
> keywords were added, instead "positional" keywords were used (much like
> "value" is a keyword only within a property setter and not anywhere
> else).  This is why it's "yield return" and not just "yield", for
> example.

In Java, I also can do

    javac -source 1.3 my-no-asserts-using-code.java

And my java 1.4 compiler will complain if there are assert instructions. 
Is there a way in mcs to achieve similar constraints?

Matthias Kempka



More information about the Mono-devel-list mailing list