Re: = vs := and = vs ==

new topic     » goto parent     » topic index » view thread      » older message » newer message
gimlet said...

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.)

  1. An object is composed of just one or many numbers.
  2. The plus character + always adds.
  3. The result of + is another number.
  4. 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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu