Sriram Krishnan said:
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!)