%mathpiper,def="HoldArgumentNumber"

Function("HoldArgumentNumber",{function,arity,index})
[
  Local(args);
  args:=RulebaseArgumentsList(function,arity);
/* Echo({"holdnr ",args}); */
  ApplyFast("HoldArgument",{function,args[index]});
];

%/mathpiper



%mathpiper_docs,name="HoldArgumentNumber",categories="Programmer Functions;Programming;Built In"
*CMD HoldArgumentNumber --- specify argument as not evaluated
*STD
*CALL
	HoldArgumentNumber("function", arity, argNum)

*PARMS
{"function"} -- string, function name

{arity}, {argNum} -- positive integers

*DESC

Declares the argument numbered {argNum} of the function named {"function"} with
specified {arity} to be unevaluated ("held"). Useful if you don't know symbolic
names of parameters, for instance, when the function was not declared using an
explicit {Rulebase} call. Otherwise you could use {HoldArgument}.

*SEE HoldArgument, Rulebase
%/mathpiper_docs