New version of makelist



following on my own suggestion that an extension of the "do" loop would 
make this all possible,
I wrote the file in  http://www.cs.berkeley.edu/~fateman/lisp/mdo.lisp

It extends the syntax of the looping construct in Maxima in the 
following way:

instead of the keyword "do"  you can use the keyword "collect", and the 
results will be returned in a list.

for i:1 thru 4 collect i  

returns [1,2,3,4].

Everything else that happens in the semantics of the "do loop" happens 
here as well, so you can
count by non-integers, start and end at symbolic points so long as they 
differ by a number,
etc.

This required a few changed lines in maxima.

It would be possible to augment the program so that the confusion about 
sum and product would be
resolved by implementing

for i:1 thru 4 sum i

for i:1 thru 4 product i

Or indeed one could provide a quite general facility such that any 
function ala "reduce" can be applied to successive terms in the loop.

This works in command line maxima but the display in wxmaxima needs to 
be altered to accomodate collect.

That is, h(n):= for i thru n collect i

displays in wxmaxima as  

h(n):=mdo-collect(i,false,false,false,n,false,i)

I do not know enough about wxmaxima to fix this.

RJF

PS,  This fix does not work for
  for i in [a,b,c] collect f(i)

which would, I think be easy enough to do by making a version of mdoin,  
say  mdoin-collect.