help-octave
[Top][All Lists]
Advanced

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

Re: Opinions on Matlab compatibility, Octave development


From: CdeMills
Subject: Re: Opinions on Matlab compatibility, Octave development
Date: Fri, 4 Jun 2010 06:44:11 -0700 (PDT)


forkandwait wrote:
> 
> 
> Exceptions I would like to see:
> 
> 1.  Named parameters a la Python like  "z = f(x=3, y=[1 2 3])"
> 
> 
Hello,

I launched this kind of discussion months ago. The replies where : "try to
implement it". I looked into the parser code, but, quite frankly, I didn't
feel at ease modifying it.

I got this idea while looking at R code. Most functions have optional
arguments, with default values specified in the function definition, like
f.i.
function normal_cdf(x, mean = 0, std = 1)
This way, chaining functions is quite easy : resu = subfun(..., mean = 4,
...)
You don't have to care about arguments position whatsoever. Whatever way
subfun is defined, the argument "mean" will be initialised to '4'. A bit
more work for the compiler, a greater comfort for the programmer.

Regards

Pascal
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Opinions-on-Matlab-compatibility-Octave-development-tp2239611p2243250.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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