Skip to content

isargout

builtin · libnexusinterp/nexus-value/ov-usr-fcn-proprietary.cc

: tf = isargout (k)

Inside a function, test whether the caller wants the k-th output.

The result is true when output position k was both requested by the caller and not discarded. A caller discards an output by writing the tilde (~) placeholder in that slot of the output list; such a position reports false even though it was nominally requested. A function can consult isargout to skip work whose only product is an unwanted output.

A position beyond what the caller requested reports false. k may be an array, in which case each element is tested and a logical array of matching shape is returned. Every element of k must be a positive integer, or an error is raised, and calling isargout outside a function, at the prompt, is also an error.