octave-maintainers
[Top][All Lists]
Advanced

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

Re: functions with 'named' arguments


From: Dupuis
Subject: Re: functions with 'named' arguments
Date: Fri, 4 Apr 2008 06:06:30 -0700 (PDT)



Dupuis wrote:
> 
> 
> This is a suggestion to introduce tagged arguments into Octave. The
> purpose is to define a mechanism where a function interface can be totally
> determined at compile-time. The interface will be defined by the three
> following parts, in the specified order:
> 1) [optionnal] required arguments
> 2) [optionnal] variable number of unspecified arguments
> 3) [optionnal] optionnal arguments, with  a known default value if they're
> not initialised within the function call
> 
> -Required arguments are in the form tag_1, tag_2, and so on. Failure to
> not provide them all must be detected as a compile-time error.
> -Unspecified arguments are in the form "..." 
> 

Just a small follow-up: the purpose of the variable-length list of
unspecified arguments should be to provide genericity, i.e. the ability for
some function to accept any supplemental argument and properly dispatch this
list to subfunctions. But those arguments have to be used somewhere in the
process, it must be detected as an error that such argument is not used
somewhere in the chain. This will occur automatically if every leaf function
does not make use of the varargin mechanism.

Regards

Pascal 
-- 
View this message in context: 
http://www.nabble.com/functions-with-%27named%27-arguments-tp16095584p16491427.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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