# Constructing an array using a function requiring multiple arguments

I am trying to construct a d-dimensional array of size M x M x ... x M using a function MyFunction. If MyFunction was a function taking only a List as input, then as I understand it the correct syntax would be

Array[MyFunction,ConstantArray[M,d]]


However, MyFunction requires three arguments, a list and two integers. I know I could just change the MyFunction by including the two integers in the list and then extracting them later, but that seems inelegant.

What I want is to do something like this:

Array[MyFunction[-,a,b],ConstantArray[M,d]],


where by - I mean I want Mathematica to insert the list of coordinates of the array entries into that argument of MyFunction. Is there a nice way to do that?

-
You need something like MyFunction[{##}, a, b] &. B.t.w., avoid using capital letters as first letters of your functions or variables, this may conflict with system symbols. –  Leonid Shifrin Apr 23 at 17:09
Thanks, worked perfectly! –  MTS Apr 23 at 21:06