how to write in a block(?) a very long "block" of statements



Hello!

I would like to write a for loop to get some numerical examples for a given
problem. The numerical part is only at the end of my mac file, so I need
maxima. :)

I would like to change this to a block that I can use in a "for list do"
statement (this is around half of the real block, but all my problems appear
inside :) ):
------------
/* best response for firm 1 is given by
max pi11+T1 in (w[1], T1)
st pi31-T1>=pi32-T2
this gives the conditions */
w1opt : substshares(substval(substbd(solve(diff(pis11, w[1])+diff(pis31,
w[1]), w[1]))))$
w1opt : w1opt, lambda=8/15;
/* the same holds for firm 2 */
w2opt : substshares(substval(substbd(solve(diff(pis22, w[2])+diff(pis32,
w[2]), w[2]))))$
w2opt : w2opt, lambda=7/15;
substshares(pis31)$
pi31eq : %, w1opt, lambda=8/15;
substshares(pis32)$
pi32eq : %, w2opt, lambda=7/15;
T1opt : substval(substbd(pi31eq-pi32eq+T2));
T2opt : substshares(substval(substbd(pi32eq-pi31eq+T1)));
---------

I think that this is equivalent to:
-------------
(
lambda2:1,
w1opt : ev(substshares(substval(substbd(solve(diff(pis11, w[1])+diff(pis31,
w[1]), w[1])))), lambda=1-lambda2),
w2opt : ev(substshares(substval(substbd(solve(diff(pis22, w[2])+diff(pis32,
w[2]), w[2])))), lambda=lambda2),
pi31eq : ev(ev(substshares(pis31), w1opt), lambda=1-lambda2),
pi32eq : ev(ev(substshares(pis32), w2opt), lambda=lambda2),
T1opt : substval(substbd(pi31eq-pi32eq+T2)),
T2opt : substshares(substval(substbd(pi32eq-pi31eq+T1))));
-----------

My problem is that lambda is not evaluated in any of these expressions, even
if it is evaluated in the original formulation.

For those who would like to see the whole mac file I have uploaded it at
http://blog.educomm.hu/tmp/ellenorzes.mac this file contains the first
formulation, and works well.

Thanks for your help!
Viktor