View Single Post
  #8 (permalink)  
Old December 2nd, 2010, 07:23 PM
Old Pedant Old Pedant is offline
Friend of Wrox
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts

Dr.Purdum wrote:
Finally, the @buff used as the argument to DriveInfo() causes the compiler to alter the attribute list for buff in the symbol table to accept any string data as a string literal.
*IF* I understand what Dr.Purdum was saying, it would mean that doing
DriveInfo myDrive = new DriveInfo(@buff);
would imply that if buff had "c:\temp" assigned to it then it would be taken literally, and \t would not mean TAB.

But that's NUTSO!!!

What if you had
String foo = "c:\temp";
in some completely separate module, some separately compiled code. You and I (and Dr. Purdum) know that OF COURSE that will be seen as the string
And then suppose you did
String buff = foo;
DriveInfo myDrive = new DriveInfo(@buff);
Would that imply that somehow the runtime would REINTERPRET the string from foo so that the [tab] magically is reconverted to two characters "\" and "t"????

I don't believe it.

comecme, I'm with you. None of this usage makes sense to me.
The Following User Says Thank You to Old Pedant For This Useful Post:
comecme (December 16th, 2010)