Re: OK what does ` mean - seriously seems to be not documented.

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

I notice that I said in an earlier post 'A' + 'B' = 131 is nonsense. I should not have used the word 'nonsense' as it isn't quite what I mean and people seem to be taking it to mean that I believe 'A' + 'B' = 131 is (or should be) invalid Euphoria.

A much better word is surprising - something that may or may not be correct but draws your attention as being odd.

Vide Derek's post:

As the colours are numbers addition is not surprising.

RED + GREEN = WHITE is somewhat **surprising** mixing colours. 
 
RED & GREEN & BLUE makes sense as {RED,GREEN,BLUE} i.e. as the composition of white. 
 
Sadly, RED + GREEN + BLUE != WHITE 
Surprising is not the same as incorrect.

Some other examples

  -60 mph is incorrect (60 mph forward or back is 60 mph) 
  RED/3 is surprising  (RED is a colour. We don't divide colours do we?) 
  RED*3 is also surprising. 
  Neither is surprising if RED is a (badly named) atomic variable 
  -60 dollars has meaning with respect to debits and credits. 

You write 'A' + 'B' and it makes sense as the addition of 2 numbers. (OK?)

Writing upper('B') = 'B' + 'a' - 'A' makes sense as defining the relation between upper and lower case: only applicable with domain 'A'..'Z'.

Pascal would have upper('B') = chr((ord('B') + ord('a') - ord('A')) which is explicit about types but is otherwise identical.

If you mix types indiscriminately in you have to be aware that you may be either incorrect or surprising. Too much surprising is a bad thing.

Defining TRUE = 0, FALSE = 1 is likely to cause confusion, of course you can do it if you like.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu