----- Original Message ----- From: "Sanin Saracevic" <[EMAIL PROTECTED]> To: "'Gaurav Vaish '" <[EMAIL PROTECTED]>; "'James Ots '" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, May 03, 2002 10:12 Subject: RE: [Mono-list] C sharp syntax [OT?]
> Hi. > According to C-sharp specification (ftp://ftp.ecma.ch/ecma-st/Ecma-334.pdf, > Section 14.2.1 Operator precedence and associativity) both member access (.) > and element access([]) operators belong to the category of primary > operators. Page 139.2 goes on to state that in case of "two operators with > the same precedence, the associativity of the operators controls the order > in which the operations are performed." Since binary operators are > left-associative, it seems clear that the expression of a form E.I[A] is > evaluated from left to right, in which case the original code in question > should compile. Sections 14.5.4 Member access and 14.5.6 Element access have > more information about resolving statements of a form E.I[A]. Am I missing > something here? BTW,MS c# compiler will accept the original statement with > no complaints. Hooh! Well, frankly speaking, I haven't looked into the operator precedence for C#. I faced this problem once into my code and then thought that the only other possible solution is putting proper braces - and it worked all fine. So, that's it. ;-) > P.S. I have been following your efforts for some time and can say only best > about it. Keep it up. Well, I had gone for a long break. Now that the exams are over, I am back again. Yo! And ya, we do need appreciations. :) Cheers, Gaurav Vaish http://mastergaurav.virtualave.net/iitk http://calendar.yahoo.com/mastergaurav ----------------------------------------- > > Sincerely, > Sanin Saracevic > > > -----Original Message----- > From: Gaurav Vaish > To: James Ots; [EMAIL PROTECTED] > Sent: 5/2/2002 9:34 PM > Subject: Re: [Mono-list] C sharp syntax [OT?] > > ----- Original Message ----- > From: "James Ots" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, May 02, 2002 02:27 > Subject: [Mono-list] C sharp syntax [OT?] > > > > > > while the following is not: > > > > IPEndPoint ipend = new IPEndPoint( host.AddressList[0], 23 ); > > Change it to the following: > > IPEndPoint ipend = new IPEndPoint( (host.AddressList)[0], 23); > > Your statement reads the following: > > IPEndPoint ipend = new IPEndPoint( host.(AddressList[0]), 23); > > which is invalid. > > HIH > > Cheers, > Gaurav Vaish > http://mastergaurav.virtualave.net/iitk > http://calendar.yahoo.com/mastergaurav > ----------------------------------------- > > > > > > Why is this? > > > > In IPHostEntry it appears the second format is used, but I get an > error > > message when I do it: > > > > ./Sock.cs(26) error CS0118: Expression denotes a `property access' > where > > a `variable' was expected > > Error: Compilation failed > > > > -- > > Cheers > > James Ots > > > > > > > > _______________________________________________ > > Mono-list maillist - [EMAIL PROTECTED] > > http://lists.ximian.com/mailman/listinfo/mono-list > > > _______________________________________________ > Mono-list maillist - [EMAIL PROTECTED] > http://lists.ximian.com/mailman/listinfo/mono-list _______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
