473,388 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Pascal assignment notation vs. C#

From my days of programming Pascal in the early 1990s, I remember
using ":=" for assignment and "=" for equality, but someone else
remembers "=" and "==" just like C#. Does anyone remember?

-
http://mysite.verizon.net/vze8adrh/news.html (profile) --Tim923 My email is valid.
Nov 16 '05 #1
16 2064
On Mon, 18 Oct 2004 14:25:11 GMT, Tim923 wrote:
From my days of programming Pascal in the early 1990s, I remember
using ":=" for assignment and "=" for equality, but someone else
remembers "=" and "==" just like C#. Does anyone remember?


You are right; he is wrong.
Nov 16 '05 #2
Hi Tim,

Digging very deep in my memory bank from the only time I ever used Pascal
(in 1996), I believe we used := for assignment, although I'm only 80% sure
of it. = would then be equality.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #3
Am Mon, 18 Oct 2004 14:25:11 GMT schrieb Tim923:
From my days of programming Pascal in the early 1990s, I remember
using ":=" for assignment and "=" for equality, but someone else
remembers "=" and "==" just like C#. Does anyone remember?

-
http://mysite.verizon.net/vze8adrh/news.html (profile) --Tim923 My email is valid.


":=" and "=" is accurate for Pascal(Delphi)
Nov 16 '05 #4
>Digging very deep in my memory bank from the only time I ever used Pascal
(in 1996), I believe we used := for assignment, although I'm only 80% sure
of it. = would then be equality.


Did BASIC use "=" for both equality and assignment? (Not Visual
Basic).

-
http://mysite.verizon.net/vze8adrh/news.html (profile) --Tim923 My email is valid.
Nov 16 '05 #5
Yes.

--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Tim923" <ju********@verizon.net> wrote in message
news:68********************************@4ax.com...
Digging very deep in my memory bank from the only time I ever used Pascal
(in 1996), I believe we used := for assignment, although I'm only 80% sure
of it. = would then be equality.


Did BASIC use "=" for both equality and assignment? (Not Visual
Basic).

-
http://mysite.verizon.net/vze8adrh/news.html (profile) --Tim923 My email
is valid.

Nov 16 '05 #6
Am Mon, 18 Oct 2004 14:56:11 GMT schrieb Tim923:
Digging very deep in my memory bank from the only time I ever used Pascal
(in 1996), I believe we used := for assignment, although I'm only 80% sure
of it. = would then be equality.


Did BASIC use "=" for both equality and assignment? (Not Visual
Basic).

yes, basic uses "=" for both.
Nov 16 '05 #7
Hi,

:= and =

http://www.ictp.trieste.it/~manuals/...x.doc.html#210

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tim923" <ju********@verizon.net> wrote in message
news:3e********************************@4ax.com...
From my days of programming Pascal in the early 1990s, I remember
using ":=" for assignment and "=" for equality, but someone else
remembers "=" and "==" just like C#. Does anyone remember?

-
http://mysite.verizon.net/vze8adrh/news.html (profile) --Tim923 My email

is valid.
Nov 16 '05 #8
Hmm..but I vaguely remember a LET statement which was meant to clear things
up

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram
"Daniel Weinand" <we***********@web.de> wrote in message
news:zy****************************@40tude.net...
Am Mon, 18 Oct 2004 14:56:11 GMT schrieb Tim923:
Digging very deep in my memory bank from the only time I ever used Pascal
(in 1996), I believe we used := for assignment, although I'm only 80%
sure
of it. = would then be equality.


Did BASIC use "=" for both equality and assignment? (Not Visual
Basic).

yes, basic uses "=" for both.

Nov 16 '05 #9
"Sriram Krishnan" <ks*****@NOSPAMgmx.net> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
Hmm..but I vaguely remember a LET statement which was meant to clear things up


Yes, originally Basic syntax required "LET X = 5" for assignment.
However, as microcomputers dawned, and Basic programs had to fit into 4K
(that's kilobytes, not megabytes) of RAM, so the syntax got shortened, as
Basic interpreter (we don't need no stickin' compilers) realized that one
could always tell which was which.

Then came C, which tried it's best to allow assembler coding conventions
in a higher level language. And to pull that off, they need to allow
assignments in the middle of a while() statement. (*) Suddenly, you could
have an assignment & a comparison in the same context, and you needed a way
of telling them apart.
(*) Putting an assignment inside a if() statement is OTOH, completely
unnecessary, and is allowed in C programs (probably) just so early C
compilers could use the same expression evaluator for both if()s and
while()s.

--
Truth,
James Curran
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
(note new day job!)
Nov 16 '05 #10
Pascal (TPacal, for DOS, WIN3.1, and later on became known as Delphi ) uses
" := "

"C# Learner" <cs****@learner.here> wrote in message
news:uz***************@csharp.learner...
On Mon, 18 Oct 2004 14:25:11 GMT, Tim923 wrote:
From my days of programming Pascal in the early 1990s, I remember
using ":=" for assignment and "=" for equality, but someone else
remembers "=" and "==" just like C#. Does anyone remember?


You are right; he is wrong.

Nov 16 '05 #11
On Mon, 18 Oct 2004 14:25:11 GMT, Tim923 wrote:
From my days of programming Pascal in the early 1990s, I remember
using ":=" for assignment and "=" for equality, but someone else
remembers "=" and "==" just like C#. Does anyone remember?


Bringing this on-topic, I much prefer ':=' and '=' to '=' and '=='
(respectively).

A quick glance at Pascal's ':=' and there's no doubt in your mind that it's
an assignment. A quick glance at C's '=', and then another glance, and
/then/ you know.
Nov 16 '05 #12

"C# Learner" <cs****@learner.here> wrote in message
news:j4***************@csharp.learner...
On Mon, 18 Oct 2004 14:25:11 GMT, Tim923 wrote:
From my days of programming Pascal in the early 1990s, I remember
using ":=" for assignment and "=" for equality, but someone else
remembers "=" and "==" just like C#. Does anyone remember?


Bringing this on-topic, I much prefer ':=' and '=' to '=' and '=='
(respectively).

A quick glance at Pascal's ':=' and there's no doubt in your mind that
it's
an assignment. A quick glance at C's '=', and then another glance, and
/then/ you know.


I disagree. I personally have no problem with distinguishing either one.

:= just looks silly.
Nov 16 '05 #13
On Mon, 18 Oct 2004 23:21:18 -0500, Daniel O'Connell [C# MVP] wrote:
:= just looks silly.


LOL
Nov 16 '05 #14
On Mon, 18 Oct 2004 23:21:18 -0500, Daniel O'Connell [C# MVP] wrote:
A quick glance at Pascal's ':=' and there's no doubt in your mind that
it's
an assignment. A quick glance at C's '=', and then another glance, and
/then/ you know.


I disagree. I personally have no problem with distinguishing either one.


Luckily for you, you're sharper than all those C-language programmers who
have had such trouble differentiating between C's equality and assignment
operators that they go so far as to writing the constant on the left-hand
side, in order that the compiler will flag an attempted assignment to it;
e.g.:

(5 == foo) /* correct */

or

(5 = foo) /* mistake -- flagged by compiler */
Nov 16 '05 #15
Which actually was a very, very usefull way to avoid hard to trace bugs.
I don't find it all that difficult to differentiate between
= and == but a typo is easily made, even more so if you're developing
both in Pascal and C ;)

Willem van Rumpt

C# Learner wrote:
Luckily for you, you're sharper than all those C-language programmers who
have had such trouble differentiating between C's equality and assignment
operators that they go so far as to writing the constant on the left-hand
side, in order that the compiler will flag an attempted assignment to it;
e.g.:

(5 == foo) /* correct */

or

(5 = foo) /* mistake -- flagged by compiler */

Nov 16 '05 #16
Willem van Rumpt <no**********************@no.spam.kooijman.nl> wrote:
Which actually was a very, very usefull way to avoid hard to trace bugs.
I don't find it all that difficult to differentiate between
= and == but a typo is easily made, even more so if you're developing
both in Pascal and C ;)


And of course, this is one reason why C# forces the type of expression
in an "if" statement to be bool...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
16
by: Edward Diener | last post by:
Is there a way to override the default processing of the assignment operator for one's own __value types ? I realize I can program my own Assign method, and provide that for end-users of my class,...
4
by: PengYu.UT | last post by:
The following shows the source code and the error message(from g++-3.3). I wrote two assignment operator. One is for the same type case, the other one is for different type case. I'm wondering why...
35
by: nagy | last post by:
I do the following. First create lists x,y,z. Then add an element to x using the augumented assignment operator. This causes all the other lists to be changed also. But if I use the assignment...
0
by: Statsstudent2006 | last post by:
Hello! I am a newbie, and have received my first VBA assignment. I have to write a subroutine that generates the Fibonacci sequence of numbers (the first n numbers, where n is an integer number...
6
by: Grey Squirrel | last post by:
On wednesday my company will have an open ended discussion whether to standardize hungarian notation or pascal/cammel case notation. We'd love to recieve some feedback on what other people are...
3
by: Grey Squirrel | last post by:
On wednesday my company will have an open ended discussion whether to standardize hungarian notation or pascal/cammel case notation. We'd love to recieve some feedback on what other people are...
61
by: warint | last post by:
My lecturer gave us an assignment. He has a very "mature" way of teaching in that he doesn't care whether people show up, whether they do the assignments, or whether they copy other people's work....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.