john.lapeyre at gmail.com
Thu Oct 9 21:48:21 CDT 2008
Robert Dodier wrote:
>I'm not sure what you want, but it seems likely you want this
>custom loop to be a macro function (defined by ::=).
Your suggestion works! (well, on my other question)
f(expr) ::= apply('create_list, [expr,i,1,3]);
[1, 2, 3];
Now I need to figure out why...
I still may end up doing Mma Table in lisp by hacking
create_list. Table allows a non-unit step in the iteration,
which create_list does not. (I got it by using 'subst' to
replace i by something like 2*i in expr and then using
create_list). I think it may be possible to allow specifying
a step in create_list in a backward compatible way. So this
way, I could possibly kill two birds with one stone-- implementing
Table and adding useful functionality to create_list.
One problem is, create_list currently allows this
so how do you do this
without confusing istep with j ?
This won't work
because that syntax is already used for supplying an explicit
list of values for i.
But I think this will work without breaking anything
On the other hand, this means that merely adding a step specification
requires supplying arguments is a very different form, which is
probably not good interface design. Maybe just a different function
entirely (like 'table') is the way to go.
More information about the Maxima