Re: = vs := and = vs ==
- Posted by _tom (admin) May 08, 2014
- 2300 views
My original comment was not a criticism but to make the point that a = b is not surprising but 'A' + 'B' is (even though it will sum in Euphoria).
The problem in documentation is learning what is "surprise." One then writes something that hopefuly makes the surprise go away. (The fun part is writing a one line description in a thousand page manual so we can say RTFM.)
- An object is composed of just one or many numbers.
- The plus character + always adds.
- The result of + is another number.
-
x = 'A' + 'B'
x has to be a number, no surprise.
If you accept the principle that Euphoria is consistent and predictable then there is no room for surprise.
If you come pre-conditioned from another language then 'A'+'B' can have an alternative meaning.
Overloading + to mean concatenation is possibly convenient; I could equally say that when plus no longer adds, I am surprised.
_tom

