splicing list of optional arguments in function call



Hi,

I have learnt here in the past (thanks!) that one can use an arbitrary
number of arguments by using [symbol], rather than a symbol itself, as
the last formal argument.  Now I have some function foo with optional
arguments, and if the non-optional first argument is an equation I
want to call foo again with the same arguments, but substituting the
difference of left and right hand sides of the equation as the first
argument.  Currently I have something like

foo(a,b,c,[z]) :=
  if inpart(a,0) = "="
  then
    buildq([a: inpart(a,1)-inpart(a,2), b, c, z],
           lambda([], foo(a,b,c,splice(z)))) ()
  else
    [ a, b, c, z ] $

Where I need the splice(z) to avoid getting an extra list around the
optional arguments, and I need the buildq to be able to use splice,
and I need the lambda([],...)() to evaluate the call, rather than
getting an unevaluated foo(...) expression.  This seems to work, but
is there a simpler way?

Thanks in advance,

Albert.