Re: String concatenation design




<andy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1143540676.814646.118800@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Anton Treuenfels wrote:
I have a numeric expression parser that allows literal strings to be
used in
logical expressions (such as comparisons) because the results of those
are
numeric. I gave the relevant string operators a very high precedence
because
that seemed the easiest way to prevent numeric operators from engaging
string operands.

So the expression

"ABC" < "DEF" + 1

is parsed as

("ABC" < "DEF") + 1

and yields the value 2.

why does boolean + numeric -> numeric.

boolean + numeric could go to boolean or be disallowed IMO.
Or is the current semantic particularly useful and if so where?

regards
Andy Little


Who said anything about booleans?


.



Relevant Pages

  • Re: String concatenation design
    ... Anton Treuenfels wrote: ... string operands. ... and yields the value 2. ... boolean + numeric could go to boolean or be disallowed IMO. ...
    (comp.programming)
  • Re: String concatenation design
    ... Barry wrote: ... Anton Treuenfels wrote: ... and yields the value 2. ... boolean + numeric could go to boolean or be disallowed IMO. ...
    (comp.programming)
  • Re: String concatenation design
    ... Barry wrote: ... Anton Treuenfels wrote: ... and yields the value 2. ... boolean + numeric could go to boolean or be disallowed IMO. ...
    (comp.programming)
  • Re: assert-like debug { /* code */ } feature?
    ... operand, and yields that value as the value of its expression. ... the value of the expression) is a boolean, ... I don't think "operator is a predicate" idea has any merit. ...
    (comp.lang.java.programmer)