A simple example that works.
(%i6) f(_i):=block([array1],local(array1), for i : 1 thru _i do array1[i]:i^2, for i : 1 thru _i do print(array1[i]))$
(%i7) f(2);
1
4
(out7) done
(%i8) array1[1];
(out8) array1[1]
--------------------------------------------------
From: "Richard Hennessy" <rich.hennessy at verizon.net>
Sent: Friday, January 08, 2010 4:25 PM
To: <maxima at math.utexas.edu>
Cc: "Edwin Woollett" <woollett at charter.net>
Subject: Re: remove hashed array inside block?
> The way I do it is as follows.
>
> block
> (
> [array1, array2, _var1, _var2],
> local(array1,array2),
> /* do some stuff */
>
> )$
>
> By using local this way the hashed arrays are removed automatically when the block exits. Also you can use recursive
> calls and it will still work, (I think I have done this), the arrays are local to the block and a new copy is made if
> you make a recursive call.
>
> Rich
>
>