how to create list of functions



Hi,

I want to create a list of functions so that I can access them via an index.

The following doesn't work, but gives and idea of what I'm trying to do:

f(x):=x;
g(x):=x^2;
h(x):=2*x;

a:[f(x),g(x),h(x)];

a[2](5);  expecting evaluation of g(x) returning 25

Can this, or something similar, be done in Maxima?

I realise I could just define a function:

a(x,i):=if i=1 then f(x) else if i=2 then g(x) else if i=3 then h(x);

but that doesn't seem very elegant.

Glenn

-- 
Glenn Ramsey  07 8627077
http://www.componic.co.nz