[Maxima] a .. b
macrakis at alum.mit.edu
Fri Jun 20 09:16:01 CDT 2008
I have no a priori feelings about this (in fact, I started off with
the notion that all members should be integers), but it seems to me
that Plan B has several advantages because it has nicer algebraic
properties (I'm assuming we all agree on the other axioms):
a) a..b always includes a
b) a..a == [a] whereas in plan A it is (if integerp(a) then [a] else )
c) a..b is of length floor(b-a+1), but in plan B it is floor(b)-ceiling(a)
d) there is no confusion about whether a..b starts with ceiling(a),
floor(a), round(a), etc.
e) as I said before, expressing B in terms of A is easier than vice versa
The main disadvantage of plan B is that a..b may include non-integers.
If this matters in a particular case, ceiling(a)..b is guaranteed to
be integers only.
I think a harder question is whether M..N where M and N are literal
numbers should always expand to a list (in the absence of lazy
More information about the Maxima