octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is_ignored_output function


From: Jaroslav Hajek
Subject: Re: is_ignored_output function
Date: Tue, 3 Aug 2010 09:42:21 +0200

On Mon, Aug 2, 2010 at 8:15 PM, Rik <address@hidden> wrote:
> Judd Storrs wrote:
>> On Mon, Aug 2, 2010 at 1:26 PM, Rik <address@hidden
>> <mailto:address@hidden>> wrote:
>>
>>     I would suggest a positive verb such as:
>>     iswanted
>>     isused
>>     isused_output
>>     iswanted_output
>>
>>
>> What about:
>>
>> isargout
>>
>> I like that it is terse (a plus in my book) and is similar in vein to
>> nargout, nargin, varargout, varargin etc.
>
> I like this suggestion as well.  It "feels" like it belongs to the same
> family of functions as nargin, nargout, etc.
>
> --Rik
>

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?

regards

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]