[Maxima] makelist vs create_list
macrakis at alum.mit.edu
Mon Apr 9 15:58:09 CDT 2007
On 4/9/07, Kostas Oikonomou <ko at research.att.com> wrote:
> Maybe I missed something, but why are we tending toward adopting the
> "i, i1..i2" range notation as opposed to "[i,i1,i2]", which, as far as I
> know, is used in lots of places in Maxima?
I can't think of any place it is used besides plotting.
I have several problems with the [i,m,n] notation:
1) it is not a natural way to specify a sequence where there is
no relevant variable name
1a) in fact in plot2d, it is used even when the variable is
2) in plotting, it specifies a *real interval*, not an integer sequence.
3) it includes the variable syntactically, where that is in fact
a separate concept from the
sequence, so it gives no natural way to manipulate the
4) in the case of create_list / makelist, how would you use it
an not have ambiguity?
I suppose you could have makelist(f(i),[i,2,4]) and
but that seems clumsy
A notation that is used elsewhere in Maxima just has multiple
arguments, with no notation at all for the sequence, e.g.
sum(..., i, m, n) also product
makelist(..., i, m, n)
for i from m thru n do...
The problem with these is that they don't give any way of specifying
the sequence itself, and don't
generalize nicely to the list case.
More information about the Maxima