Pascal uses := for assignment and = for comparison. It took about 5 minutes to get used to this notation. I rather like it...
let x = 1;
(...)
let x = x + 1;
x := 1;
let y = 2*x + 1; // Could be ':=' here, open to discussion. Now 'y' holds '3'.
(...)
x := x + 1; // When this assignment is completed, 'y = 2*x+1' still holds, so 'y' now holds '5'.
how much time you "assign" vs time you "compare"? i think "assign" is much more used/typed... so assign using "=" and compare using "==" is much more sensible
IF a = b
a := b
how much time you "assign" vs time you "compare"? i think "assign" is much more used/typed... so assign using "=" and compare using "==" is much more sensible, that is C, and i dont have to keep pressing shift key so many times. https://www.jonathanshultsmd.com/blog/can-typing-cause-carpal-tunnel-syndrome
However, another factor to consider is the number of times a program is read rather than written. In my case this is often many thousands of times more.
I still haven't got the hang of how to read "=" and "==" in my head without it being awkward.
Pascal uses := for assignment and = for comparison. It took about 5 minutes to get used to this notation. I rather like it...
Yeah this is fine and a no-brainer. I don't really see a point of trying to invent something else. It just works.
I think that was discussed in older threads too. I don't really like the "let" keyword and it's not for parsing or typing reasons. I personally think "let" is ill-used for normal assignment, as to me it should not be used to change values of objects but only to define them as an invariant - that's how it's usually used in maths.
So if I see something like:Code: [Select]let x = 1;
(...)
let x = x + 1;
It doesn't look right to me.
IMHO, if we want to find a use for a "let" keyword, it should preferably be used as a invariant definition. For instance (types are omitted):Code: [Select]x := 1;
let y = 2*x + 1; // Could be ':=' here, open to discussion. Now 'y' holds '3'.
(...)
x := x + 1; // When this assignment is completed, 'y = 2*x+1' still holds, so 'y' now holds '5'.
This feature looks pretty cool to me. The "let" keyword may not be the best either and could be replaced by something else more explicit, such as just "invariant".
how much time you "assign" vs time you "compare"? i think "assign" is much more used/typed... so assign using "=" and compare using "==" is much more sensibleIndeed. My Oberon code base shows ':=' (assign) is used 5 times more than '=' (compare). However, another factor to consider is the number of times a program is read rather than written. In my case this is often many thousands of times more.
Beginner Pascal / Oberon programmers are taught to pronounce := as "becomes equals". ThenCode: [Select]IF a = b
is read as "If a equals b ..."
andCode: [Select]a := b
is read as "a becomes equal to b"
I still haven't got the hang of how to read "=" and "==" in my head without it being awkward.
Pascal uses := for assignment and = for comparison. It took about 5 minutes to get used to this notation. I rather like it...
Pascal uses := for assignment and = for comparison. It took about 5 minutes to get used to this notation. I rather like it...
Yup. Faster than to get used to than = and ==, and less prone to unnoticed errors.
The clearest assignment operator is, of course ← as in "x ← x + 1". Bonus points for recognising which language got that right many decades ago
As long as you don't have to give it a three-fingered salute, who cares whether one or two characters has to be typed. We're not using ASR33s anymore, are we mechatrommer?.
avg ← { (+ / ⍵) ÷ ⍴ ⍵ }
Pascal uses := for assignment and = for comparison. It took about 5 minutes to get used to this notation. I rather like it...
Yup. Faster than to get used to than = and ==, and less prone to unnoticed errors.
The clearest assignment operator is, of course ← as in "x ← x + 1". Bonus points for recognising which language got that right many decades ago
As long as you don't have to give it a three-fingered salute, who cares whether one or two characters has to be typed. We're not using ASR33s anymore, are we mechatrommer?.
Ahh APL, of which I have fond memories from my early 1980s mainframe days!
Here's a great sight for playing with APL, such an expressive language, here's the definition of a function to calculate the average of any number of integers:Code: [Select]
avg ← { (+ / ⍵) ÷ ⍴ ⍵ }
Pascal uses := for assignment and = for comparison. It took about 5 minutes to get used to this notation. I rather like it...
Yup. Faster than to get used to than = and ==, and less prone to unnoticed errors.
The clearest assignment operator is, of course ← as in "x ← x + 1". Bonus points for recognising which language got that right many decades ago
As long as you don't have to give it a three-fingered salute, who cares whether one or two characters has to be typed. We're not using ASR33s anymore, are we mechatrommer?.
Ahh APL, of which I have fond memories from my early 1980s mainframe days!
Here's a great sight for playing with APL, such an expressive language, here's the definition of a function to calculate the average of any number of integers:Code: [Select]
avg ← { (+ / ⍵) ÷ ⍴ ⍵ }
I wasn't thinking of APL, since I'm not a fan and it hasn't been very influential. By and large APL seems to be a mistake carried through to perfection. There is one thing that APL did get right, the difference between "-3" and "¯3". But that is "correcting" a standard quirk with maths notation that requires every generation to learn about that mistake.
APL has formed the basis of, or influenced, the following languages:[citation needed]
A and A+, an alternative APL, the latter with graphical extensions.
FP, a functional programming language.
Ivy, an interpreter for an APL-like language developed by Rob Pike, and which uses ASCII as input.[46]
J, which was also designed by Iverson, and which uses ASCII with digraphs instead of special symbols.[7]
K, a proprietary variant of APL developed by Arthur Whitney.[8]
MATLAB, a numerical computation tool.[6]
Nial, a high-level array programming language with a functional programming notation.
Polymorphic Programming Language, an interactive, extensible language with a similar base language.
S, a statistical programming language (usually now seen in the open-source version known as R).
Speakeasy, a numerical computing interactive environment.
Wolfram Language, the programming language of Mathematica.[47]
No, I was thinking of a language that has been extremely influential and is better than quite a few of its successors. That language's syntax can be easily described with examples on a single sheet of A4 paper. Very few languages manage anything close.
Here's a great sight for playing with APL, such an expressive language, here's the definition of a function to calculate the average of any number of integers:Code: [Select]
avg ← { (+ / ⍵) ÷ ⍴ ⍵ }
Here's a great sight for playing with APL, such an expressive language, here's the definition of a function to calculate the average of any number of integers:Code: [Select]
avg ← { (+ / ⍵) ÷ ⍴ ⍵ }
You call that expressive, I call that a fantastic exercise in obfuscation.
Apart from the assignment symbol that almost anyone with a programming experience will get, the right hand part is undecipherable.
I'm under the impression again that you are conflating expressiveness with the least number of keystrokes possible.
function test binary(31)
declare a string
while true
a = a + 1
end
end
fonction test binaire(31)
déclarer a chaîne
pendant que true
a = a + 1
fin
fin
Pascal uses := for assignment and = for comparison. It took about 5 minutes to get used to this notation. I rather like it...
Yup. Faster than to get used to than = and ==, and less prone to unnoticed errors.
The clearest assignment operator is, of course ← as in "x ← x + 1". Bonus points for recognising which language got that right many decades ago
As long as you don't have to give it a three-fingered salute, who cares whether one or two characters has to be typed. We're not using ASR33s anymore, are we mechatrommer?.
Pascal uses := for assignment and = for comparison. It took about 5 minutes to get used to this notation. I rather like it...
Yup. Faster than to get used to than = and ==, and less prone to unnoticed errors.
The clearest assignment operator is, of course ← as in "x ← x + 1". Bonus points for recognising which language got that right many decades ago
As long as you don't have to give it a three-fingered salute, who cares whether one or two characters has to be typed. We're not using ASR33s anymore, are we mechatrommer?.the fact is.. pascal is dead (technically), and you dont have anything to back it up, whether mechatrommer exists or not... whats grew on everybody today is Python, which uses the same assign and compare syntax as C... https://www.pythontutorial.net/python-basics/python-comparison-operators/
Python relies on indentation to express containment/nesting, it is a horrible accident waiting to happen.
Python relies on indentation to express containment/nesting, it is a horrible accident waiting to happen.learn from the lesson or else....
do you really want to reinvent ASR33's age ":="?
I still haven't got the hang of how to read "=" and "==" in my head without it being awkward.because your mother language (pascal) clouded your mind, make you harder to get around another language, esp a language as good a c ... if we just follow a language's notion and grammar, rather than our heart desire.. there should be no problem.. but then just as you pick your fav language.. i also did and abandon pascal grammar for the above logical reason, and some other technical reasons.