What's the difference between = and :=
Author |
Message |
Danyn
|
Posted: Tue Dec 03, 2013 9:47 pm Post subject: What's the difference between = and := |
|
|
Not exactly a question that requires code, just looking for some clarification. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
evildaddy911
|
Posted: Tue Dec 03, 2013 9:53 pm Post subject: RE:What\'s the difference between = and := |
|
|
ok, so '=' is used for comparison; its used in 'if' statements; while ':=' is used for assignment, where you assign values to variables.
for example,
Turing: |
x := 5
if x = 5 then
|
however, the turing compiler will accept '=' in place of ':=', meaning that
Turing: |
x = 5
% is equivalent to
x := 5
|
unfortunately, the reverse is not true.
will not compile |
|
|
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Wed Dec 04, 2013 1:55 pm Post subject: RE:What\'s the difference between = and := |
|
|
Don't get this confused with other languages.
Java, C and Python (that I know for sure) use = for assignment, and use == for comparisons. |
|
|
|
|
![](images/spacer.gif) |
mr.frenchman
|
Posted: Wed Dec 04, 2013 2:34 pm Post subject: RE:What\'s the difference between = and := |
|
|
In pascal and delphi " := "- used for assigning value |
|
|
|
|
![](images/spacer.gif) |
|
|