Click here to Skip to main content
15,909,091 members
Home / Discussions / C#
   

C#

 
AnswerRe: Firefox URL Pin
Luc Pattyn8-Aug-10 1:00
sitebuilderLuc Pattyn8-Aug-10 1:00 
AnswerRe: Firefox URL Pin
Mycroft Holmes8-Aug-10 2:09
professionalMycroft Holmes8-Aug-10 2:09 
GeneralMessage Closed Pin
8-Aug-10 8:41
nhqlbaislwfiikqraqnm8-Aug-10 8:41 
AnswerRe: Firefox URL Pin
Saint_pl26-Aug-10 5:58
Saint_pl26-Aug-10 5:58 
QuestionCrystal report Pin
tek 20097-Aug-10 0:57
tek 20097-Aug-10 0:57 
AnswerRe: Crystal report Pin
PIEBALDconsult7-Aug-10 6:04
mvePIEBALDconsult7-Aug-10 6:04 
QuestionCannot implicitly convert type 'object' to 'bool' Pin
Tichaona J7-Aug-10 0:49
Tichaona J7-Aug-10 0:49 
AnswerRe: Cannot implicitly convert type 'object' to 'bool' PinPopular
Luc Pattyn7-Aug-10 1:20
sitebuilderLuc Pattyn7-Aug-10 1:20 
AnswerA suggestion Pin
Richard MacCutchan7-Aug-10 2:45
mveRichard MacCutchan7-Aug-10 2:45 
GeneralRe: A suggestion [modified] Pin
harold aptroot7-Aug-10 4:10
harold aptroot7-Aug-10 4:10 
GeneralRe: A suggestion [modified] Pin
Luc Pattyn7-Aug-10 4:37
sitebuilderLuc Pattyn7-Aug-10 4:37 
GeneralRe: A suggestion Pin
Richard MacCutchan7-Aug-10 5:34
mveRichard MacCutchan7-Aug-10 5:34 
GeneralRe: A suggestion Pin
Luc Pattyn7-Aug-10 5:38
sitebuilderLuc Pattyn7-Aug-10 5:38 
GeneralRe: A suggestion Pin
alton.turner9-Aug-10 14:04
alton.turner9-Aug-10 14:04 
GeneralRe: A suggestion Pin
TNCaver9-Aug-10 6:48
TNCaver9-Aug-10 6:48 
GeneralRe: A suggestion Pin
Luc Pattyn9-Aug-10 6:56
sitebuilderLuc Pattyn9-Aug-10 6:56 
GeneralRe: A suggestion Pin
Kenneth Kasajian9-Aug-10 9:13
Kenneth Kasajian9-Aug-10 9:13 
GeneralRe: A suggestion Pin
Jonathan C Dickinson9-Aug-10 21:44
Jonathan C Dickinson9-Aug-10 21:44 
GeneralRe: A suggestion Pin
Richard MacCutchan9-Aug-10 22:03
mveRichard MacCutchan9-Aug-10 22:03 
GeneralRe: A suggestion Pin
Jonathan C Dickinson10-Aug-10 0:11
Jonathan C Dickinson10-Aug-10 0:11 
GeneralRe: A suggestion Pin
Richard MacCutchan10-Aug-10 0:43
mveRichard MacCutchan10-Aug-10 0:43 
GeneralRe: A suggestion Pin
Jonathan C Dickinson10-Aug-10 1:17
Jonathan C Dickinson10-Aug-10 1:17 
Hurm... The example doesn't need a == operator because it is demonstrating what is possible when a = and a == are distinct. With == around; = becomes more versatile. Because = is more versatile the example I gave is possible.

If there was only = (and no ==) the example I gave simply wouldn't work (you would get an warning saying that a boolean is never null). I think the mathematical term for this kind of 'proof' is proof by contradiction.

The compiler would recognize != as the not equals operator, BUT it would recognize the = as identity equality and not assignment. Thus the AST would look (where the VB-route is taken) something like this:

WHILESTMT(BOOLEXPR(BOOLEXPR("line", Operator.IdentityEquality, "reader.ReadLine"), Operator.IdentityInequality, NULL))

As opposed to (and why my example works):

WHILESTMT(BOOLEXPR(BOOLEXPR("line", Operator.Assign, "reader.ReadLine"), Operator.IdentityInequality, NULL))

More simply, the following expression results in a boolean type (and boolean value) in VB:

a = b

In C# is results in the type of 'a' (and the value contained by 'a'). Which is why these statements are possible:

int0 = int1 = int2 = int3 = int4 = 0; // Set all to 0.
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Chineese Proverb]

Jonathan C Dickinson (C# Software Engineer)

GeneralRe: A suggestion Pin
Richard MacCutchan10-Aug-10 1:48
mveRichard MacCutchan10-Aug-10 1:48 
GeneralRe: A suggestion Pin
Jonathan C Dickinson10-Aug-10 21:25
Jonathan C Dickinson10-Aug-10 21:25 
GeneralRe: A suggestion Pin
Keith Barrow7-Aug-10 5:13
professionalKeith Barrow7-Aug-10 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.