Thankyou for the comments. I was getting lost in the details
with inpart(v,1), etc. I hope I can explain this
succinctly. I can probably figure out how to do it
eventually, but if anyone is interested ...
I am trying to emulate Mathematica's Table command (there
are a few reasons for that). It is similar to create_list,
but its not just the same thing with different syntax, for instance,
Table can make nested structures.
with create_list, I can do
case 1) create_list( x^2, x, 1, 10);
or
case 2) create_list( f(x), x, 1, 10),
where f is any function (as far as I can tell)
The table function looks kind of like this
table(expr,x) := apply('create_list,[expr,x,1,3]);
With this function 'table', I can always get things like the
first case to work, but not always the second.
In particular there are some functions such that, if
x is not bound, trying to evaluate f(x) causes an error,
eg.
(%i75) g(x) := while x > 0 do x:x-1 $
(%i76) g(10);
(%o76) done
(%i77) g(x);
Maxima was unable to evaluate the predicate:
x > 0 ...
create_list can handle this:
(%i78) create_list(g(x),x,1,3);
(%o78) [done,done,done]
but table cannot. table(g(x),x) gives the same error as
typing g(x) above. Thats the problem I was trying to solve
(without resorting to lisp).
And using apply from the command line gives the same error:
(%i80) apply('create_list,[g(x),x,1,3]);
Maxima was unable to evaluate the predicate:
x > 0 ...
Thanks,
John