Let
a=: 'a'
b=: 'b'
c=: 'c'

and let 
arr=: a;b;a;c;b;c;a;b;b;b;c;a;b NB. i.e. all items from a,b,c

I want to relabel the items 
with 
e=: 'e'
f=: 'f'
g=: 'g'
 so a -> e, b -> f, c -> g.
so arr becomes 
e;f;e;g;f;g;e;f;f;f;g;e;f

Is there a succinct (preferably tacit) way to do this? 
I feel like there should be, but can't find a way, so my current 
method is to use a for__i. loop, which feels very clumsy for 
something that seems should have a nice solution.

Thanks,
Jon

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to