[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is_ignored_output function
From: |
Rik |
Subject: |
Re: is_ignored_output function |
Date: |
Tue, 03 Aug 2010 08:01:01 -0700 |
>
> OK, I renamed the function to isargout and changed the semantics.
> isargout(k) now returns true if k is within 1..max(nargout,1) and not
> assigned to ~. An important exception is nargout=0, in which case
> isargout(1) is true. This corresponds to the usual behavior of
> functions where the first output is computed even if it's not assigned
> to a named variable. Does anyone feel that this exception should be
> omitted and left to the user to deal with?
No, your choice for nargout=0 behavior seems correct.
Generally, if I don't know about a function I might call it with zero
output arguments, but also with zero input arguments, and then let the
input validation print the usage information. If I have called the
function in some otherwise correct fashion, except for nargout=0, I
probably know what I'm doing and want the output calculated.
--Rik