Try
apply('declare, [concat('K, i, j, k), constant]);
Viktor
-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of ptomaine
Sent: Wednesday, May 09, 2007 7:51 AM
To: maxima at math.utexas.edu
Subject: Dynamically declare variables
Hello.
I am a newbie to Maxima and I have a question.
I have a lot of variables: K111, K112, K113, K121, etc. And want to
declare all of them constant.
But running
for i : 1 thru 3 do
for j : 1 thru 3 do
for k : 1 thru 3 do
declare( concat('K, i, j, k), constant );
Fails with
Improper argument to declare:
concat('K, i, j, k)
-- an error. To debug this try debugmode(true);
What is correct way to achive the same result as with the following?
declare( K111, constant );
declare( K112, constant );
....
declare( K333, constant );
Thanks in advance, ptomaine//
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima