Body of For Loop



Richard,

I doubt that that is what Knudsen wants to do.  Assigning p:i does not
substitute i for p in myEquations:

(%i9) myeqs: [x=2*p,y=p^2];
(%o9) [x = 2*p,y = p^2]
(%i10) p:23$
(%i11) myeqs;
(%o11) [x = 2*p,y = p^2]   <<< no substitution performed

            -s


On Thu, Jan 6, 2011 at 17:36, Richard Hennessy <rich.hennessy at verizon.net>wrote:

> You probably want to do.
>
>
>
> for i from 1 thru 10 do (
> (
>   p : i,
>   specificEquations : myEquations,
>   print(specificEquations)
> );
>
> In a program the syntax is a little different since commas indicate the end
> of a statement (in a program).
>
> Rich
>
>
> -----Original Message----- From: Michael Knudsen
> Sent: Thursday, January 06, 2011 2:30 PM
> To: maxima at math.utexas.edu
> Subject: Body of For Loop
>
>
> Hi,
>
> I have a list of equations called myEquations, and they all depend on
> a single parameter p. Using a command like
>
> specificEquations : myEquations, p = 1;
>
> one gets a new list, specificEquations, containing the original
> equations with 1 substituted for the variable p. So far, so good!
> However, if I try to do something similar in a for loop, something
> strange happens.
>
> for i from 1 thru 10 do (
>
> (specificEquations : myEquations, p = i),
> print(specificEquations)
>
> );
>
> Here all print statements yield the same output, which is just
> myEquations with no value substituted for p.
>
> What am I missing here? Thanks in advance!
>
> Michael Knudsen
>
> --
> Michael Knudsen
> micknudsen at gmail.com
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>