Defining functions of vectors?



I'm playing around with some code and I'd like to be able to define a
vector function, something like

f(x) := 5.04*x[1]+0.035*x[2]+10*x[3]+3.36*x[5]-0.063*x[4]*x[7];

This doesn't actually do what I want.  f(y) doesn't replace x with y.
f([1,2,3,4,5,6,7]) doesn't actually evaluate the expression at the
given point.  (Actually, in this case f is really a function of 10
variables, but only 7 are used.)

I know I could write it like f(x1,x2,x3,x4,x5,x6,x7), but for the
application I'm looking at f could be a function of 100 variables, and
I don't want to write out all 100.

I eventually want to compute the gradient of f too, so grad(f,x)
should gradient of f as a function of x[].  Hints would be
appreciated. 

Thanks,

Ray