I'm looking for a command \takeargs{n}
(in either TeX or LaTeX) such that
f \takeargs{n} {x_1} ... {x_n} = f\ x_1\ ...\ x_n
, that is (if I understood that part)
\takeargs{0} =
\takeargs{n} \sometoken = \ \sometoken \takeargs{n-1}
Background: In my document, I define some functions (in Haskell-Syntax, which uses spaces for function application). On my constant striving towards don't-ever-repeat-yourself, I'd like to have newcommands for them defined automatically as I go, so I can write
\declarefunction{LaunchRockets}{2}{Coords}{Warhead}{IO ()}
% ^ Prints the function name and type and creates \CallLaunchRockets
% ...
Let $p$ be the target coordinates. Then for a huge boom we could e.g.
do a $\CallLaunchRockets p \Nuclear$ ...
% ^ Expands to $\mycodefont{LaunchRockets}\ p\ \Nuclear$
n
arguments why not just put the space in manually? Unless the elements (or tokens) are generic of sorts.