On 6/9/06, Vadim V. Zhytnikov <vvzhy at mail.ru> wrote:
>
>
> How about x=a..b notation for interval?
I've always liked that notation, used in several programming languages.
Before we add it, though, we should probably fix the Maxima lexer/parser so
that various cases are treated more intuitively:
infix("..")$
0..2 => error, is treated as 0. followed by .2; should be 0 .. 2
0.. 2 => treated like 0. . 2; should be 0 .. 2
0...2 => treated like 0. .. 2, not 0 .. .2 (maybe OK)
There are similar issues currently with "." (non-commutative product), but
that is rarely used with numeric constants, while .. will commonly be used
with numeric constants.
I would also recommend that we clarify the semantics of ".." before we put
it out. I would suggest that a..b be defined as the set of all numbers x
such that a<=x<=b. Thus, a..a == a and a..b where b<a == empty set.
We might also want to define a ternary operator a..b..c meaning the set of
all x=a+I*b (I a non-negative integer) such that a<=x<=c.
-s