search and replace in expression?



Leo Butler wrote:
> On Wed, 30 Dec 2009, Rui Maciel wrote:
> 
> < Let's say we have a list like the following:
> <
> < (%i1) d:[d1,d2,d3,d4,d5,d6,d7,d8];
> < (%o1)                     [d1, d2, d3, d4, d5, d6, d7, d8]
> <
> < Let's suppose that I changed my mind and, instead of a list with
>  variables < named d[0-8], I wish to have a list with variables named
>  x[0-8] and two other < lists with variables named y[0-8] and z[0-8].
> 
> To create your list, try
> d :  makelist(concat('d,i),i,1,8);
> 
> If you want to create new lists via substitution, then subst can do it
> subst( makelist(concat('d,i)=concat('x,i),i,1,8), d );
> 
> although it is probably easier to create the list from scratch.

<snip/>

> Yes, I believe that subst can handle most of your needs. If you have other,
>  more specific questions/tasks, please ask.

Your suggestion works great. The concat() function appears to be exactly what 
I was looking for. Thanks!


Rui Maciel