Google-Apps
Hauptmenü

Post a Comment On: Geeks At Work

"Implicit variable declaration in .NET 3.5"

2 Comments -

1 – 2 of 2
Blogger JV said...

You've greatly confused "type inference" with "implicit variable declaration." The type of the variable is being inferred from the type of what the right hand expression resolves to. This is greatly different from implicit variable declaration, where I might omit the "var" entirely and say "i = 0;" and the compiler says "Oh, there is no i as an identifier in the symbol table, I will take this as its declaration and create it for you." PHP is an example of a language that has implicit variable declaration, this is on top of dynamic typing, and therefore type inference. I recommend you change this post greatly as to avoid confusing people.

June 30, 2010 at 11:38 AM

Blogger Unknown said...

JV you are mistaken. Per the MSDN reference this is in fact an example of implicit variable declaration.

http://msdn.microsoft.com/en-us/library/ms364047(VS.80).aspx

"When a local variable declaration specifies var as the type and no type named var is in scope, the declaration is an implicitly typed local variable declaration."

July 7, 2010 at 3:53 AM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot