> -----Original Message-----
> From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of
> Jon Jagger
> In his book, Jeffrey Richter says
> only that it is for reasons best known to and understood by compiler
> writers. Is there a deep reason you hit when implementing the compiler?

Sure it was Richter's book? I havent read Richter, but I encountered that
exact phrase in Petzold's Programming Windows With C#.
FWIW - I think Petzold misunderstood/misrepresented something there. His
example was referring to someControl.Size.Width * 2; something which will
fail because the Size property will return a copy of the Size struct. Making
changes to the Width property of the returned struct will have no effect on
the original and the whole statement is pointless. The compiler recognizes
this and issues a warning(or an error - dont remember offhand).
This wouldnt apply when you have a property that is an instance of a
referencetype, something Petzold failed to mention.

Arild Fines

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to