octave-maintainers
[Top][All Lists]
Advanced

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

Re: Package Contribution Procedure and Best Way to Interpret Name, Value


From: PhilipNienhuis
Subject: Re: Package Contribution Procedure and Best Way to Interpret Name, Value Arguments?
Date: Sat, 31 Dec 2016 08:43:27 -0800 (PST)

Chris Adams wrote
> Hello,
> 
> I'd like to contribute to octave by writing some of the missing functions.
> I've just finished statelevels, patch #9199.
> 
> Question 1)
> What's the proper procedure for submitting these functions? I've uploaded
> an m file and nothing else. Is anything else needed?

The m-file itself could use some tests.

Other things:
An entry in the INDEX file
An entry in the NEWS file about the new function
You'd help the package maintainer a lot by preparing a Mercurial changeset
including these as well. 


> Question 2)
> Now that statelevels exists, I can write dutycycle. This function will
> have
> a few *Name,Value* variable arguments. Is there a standard way to
> interpret
> these?

There's the inputparser class in core Octave. I've never used it but I think
it can do the job.

Another way is using varargin and a switch statement processing all
name,value pairs in turn and providing defaults for those not specified by
the user. An example (not necessarily the best one) is in strread.m (core
Octave) starting at L.236 

Philip



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Package-Contribution-Procedure-and-Best-Way-to-Interpret-Name-Value-Arguments-tp4681197p4681198.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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